Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A Model Class is the central configuration point of the Optimization module. It defines the structure and the look and behavior of Model Objects. The user workflow consist of sequence of Steps. In each Step, the user can run a Calculation and then explore and evaluate the results on multiple Tabs.The Model Class definition is stored in a table with type code MC, which has following fields:

View/edit rights can be defined for Model Classes and they are then inherited to Model Objects (and can be further restricted on the model level). For more details on permissions see Module Categories.

Fields

  • uniqueName* – Unique name of the Model Class. It is used in Model Object to reference the Model Class they instantiate. Note , that you can modify the uniqueName, but the references won’t will not be updated automatically.

  • label – Human readable name of the Model Class, displayed to the users, when they select which Model Class they want to use for creating a new Model Object.

  • definition – Defines , how the Model Class instances will look and behave. It stores definitions of Calculations, Steps and Evaluations in a JSON text format.

  • hideFromNewModelDialog – If set to true, the Model Class is not available for selection in the Create New Model dialog or in the quick filter drop-down list for the Model Class column in the Models table.

  • workflowFormulaName – Name of the workflow logic (with workflowType = “model”) which is responsible for building the approval workflow steps , when the user clicks Submit. If not set, when the user submits the model, it is auto-approved and marked as “No Approval Required”.

...

  • then the workflow feature is disabled for those Model Objects.

  • moduleCategoryUN – Defines which Module Category should display a list of Models which are based on this Model Class. User groups defined in this Module Category will be applied to the Model Class, see also Module Category > Access Rights - Roles and User Groups.

  • elementsUserGroupViewDetails – Comma separated list of user groups' unique names. Users can view Model Objects of this Model Class but not edit them.

  • elementsUserGroupEdit – Comma separated list of user groups' unique names. Users can edit Model Objects of this Model Class but not create/delete them.

  • elementsUserGroupManage – Comma separated list of user groups' unique names. Users can create/edit/delete Model Objects of this Model Class.

Definition

Model Class Definition defines how the Model Class instances will look and behave.

In a Model Class, the definition field contains a JSON document that has three main root elements: calculations, steps and , evaluations, actions, tasks.

Calculations (calculations)

A list of calculation. A Calculation defines a calculation process , which can be started from a Step.

...

  • name* – Name of the Calculation, unique within this Model Class. Must use only alphanumeric characters or dash (no white spaces).

  • type* – Accepted values:

    • formula – Simple calculation, all actions in the provided logic are done in a sequential order.

    • parallel – Parallel calculation. The calculations done by the logic can be split into more parts (called Items) and the calculation of those Items will be done in parallel.

    • sequence – This calculation does not have a logic, it is only reference to a list of other calculations , which should be executed one by one.

  • formulaName* – Unique name of a Logiclogic. Used only for formula and parallel types.

  • sequence* – List of Calculation names defined in this Model Class. Used only for the sequence type.

Step (steps)

A list of Steps and their Calculations, Tabs and their Evaluation Logicslogics.

Example:

Code Block
languagejson
{
  "steps": [
    {
      "name": "step1",
      "label": "First Step",
      "description": "This step has 1 calculation and 1 tab.",
      "calculation": "calc1",
      "tabs": [
        {
          "name": "tab1",
          "label": "First Tab",
          "type": "dashboard",
          "formulaName": "POAI_Test_Dashboard1"
        }
      ]
    },
    {
      "name": "step2",
      "label": "Second Step",
      "description": "This step has 1 sequence calculation and 3 tabs.",
      "calculation": "seq",
      "tabs": [
        {
          "name": "tab1",
          "label": "First Tab",
          "type": "simple",
          "formulaName": "POAI_Test_Dashboard2"
        },
        {
          "name": "tab2",
          "label": "Configurator Tab",
          "type": "configurator",
          "formulaName": "POAI_Test_Configurator"
        },
        {
          "name": "tab3",
          "label": "Visual Tree",
          "type": "filtertree",
          "treeName": "Segments",
          "formulaName": "POAI_Test_FilterTreeNodeEval",
          "selectedNodeIdsInputName": "selectedNodeIds"
        }
      ]
    }
  ]
}

Each Step has the following fields:

  • name* – Name of the step, unique in the Model Class. Must use only alphanumeric characters or dash (no white spaces).

  • label – Human readable name of the step, shown in the UI, it defaults to name if not specified.

  • description – Description of the step, shown in the UI.

  • calculation – Name of the calculation associated to this step, optional.

  • tabs – List of Tabs as defined below.

Each Tab has the following fields:

  • name* – Name of the tab, unique in the step. Must use only alphanumeric characters or dash (no white spaces).

  • label – Human readable name of the Tab, shown in the user interface. It defaults to name if not specified.

  • type* – Determines , how the Tab will present the content to the user.

    • dashboard – The content of the tab will be rendered as a dashboard, i.e. input fields on left side, and portlets on the right side.

    • simple – The content of the tab will show the inputs generated by the logic on the left, and on the right side there will be results from the visible elements NOT as portlets, but rather one after another, as a simple list of values (e.g. similar to quote item calculation results).

    • configurator – The content of the tab will be rendered as the Configurator form, i.e. as a list of various input fields, whose values typically have dynamic dependencies.

    • filtertree – The content of the tab will be rendered as a tree (used for example to visualize the Segmentation Tree in the Negotiation Guidance Accelerator), and when you select/click one node, it will show details of the node on the right side, visualized as calculation results (e.g. similar to quote item calculation results).

  • formulaName* - unique – Unique name of an existing Logiclogic. Depending on the field type (see above), the logic will serve different purposepurposes, and it must be of different natureNatures.

    • for For dashboard type - it – It must be Model Evaluation Logic, which is expected to return input fields (filters) and content for portlets.

    • for For simple type - it – It must be Model Evaluation Logic, which is expected to return mostly simple types of values.

    • for For configurator type - it – It must be Model Evaluation Configurator Logic, which is expected to return the definition of form sections with input fields.

    • for For filtertree type - it – It must be Model Evaluation Logic. It will be used at the moment, when the user clicks on the node of the tree. So a tree node, so the logic is expected to return various detailed information about the selected node.

  • treeName* (only for filtertree type) – Name of the tree to be displayed in the Tab. The tree is expected to be stored in the model.

  • selectedNodeIdsInputName* (only for filtertree type) – Name of the input parameter passed to the evaluation logic, containing the list of selected node IDs.

...

This is used mostly for integration of the model with other modules. When other another module (e.g. Quoting) needs to access the model results, it can either read the model data tables directly, or rather call the Evaluation to provide the data in a certain way. So, in a way, you can think about of it as an API for reading the model.

Note , that these Evaluations are not the same , and as the evaluations used to provide content for Tabs.

...

Code Block
languagejson
{
  "evaluations": [
    {
      "name": "query_-results",
      "formulaName": "POAI_Test_QueryResults"
    }
  ]
}

Each evaluation has the following fields:

  • name* – Name of the evaluation, unique in the Model Class. Must use only alphanumeric characters or dash (no white spaces).

  • formulaName* – Unique name of an existing Logic logic of nature model_evaluation, see also Model Evaluation Logic.

Info

See Query Optimization Engine Results to execute an evaluation from another logic.

Actions (actions)

When you need to run recalculation of certain Steps or Calculations of a Model Object regularly, you can configure a list of available actions which could be scheduled. The end user can set up a calculation schedule of those actions via UI on the model object detail page. The scheduling can also be done via SchedulesContext available using the method schedulesContext() on the Model Context.

Example of actions definition:

Code Block
languagejson
{
  "actions": [
    {
      "name"    : "scheduled-steps",
      "label"   : "Execute Both Steps",
      "type"    : "steps",
      "fromStep": "schedule",
      "toStep"  : "summary"
    },
    {
      "name" : "scheduled-task",
      "label": "Execute the Scheduled Task",
      "type" : "task",
      "task" : "scheduled-task"
    }
  ]
} 

Each action has the following fields:

  • name* – Name of the action, unique in the Model Class. Must use only alphanumeric characters or dash (no white spaces).

  • label* – Description of the action, visible to the end user on the model object Schedule page.

  • type* – What type of action is performed. Available options are:

    • steps – This action will perform calculations from a range of Steps. It can be performed only if the model is editable (i.e. not submitted/approved).

    • task – This action will perform a specified task.

  • fromStep – (Only for the type steps. Optional.) Name of a Step. When specified, the action will process Steps starting with this one. When not specified, the action will process Steps starting from the first one.

  • toStep – (Only for the type steps. Optional.) Name of a Step. When specified, the action will process Steps until, and including, this one. When not specified, the action will process Steps until, and including, the last one.

  • task* – (Only for type task.) Name of the task to be performed. The task must be defined within the same Model Class.

Tasks (tasks)

Info

Since version 11.0

When you need to run calculations regularly by using an Action of the type task, the Task must be defined in the Model Class as follow.

Example of tasks definition:

Code Block
languagejson
{
  "tasks": [
    {
      "name"       : "scheduled-task",
      "label"      : "Scheduled Task",
      "type"       : "post-approval-calculation",
      "calculation": "scheduled-task"
    }
  ]
}

Each task has the following fields:

  • name* – Name of the task, unique in the Model Class. Must use only alphanumeric characters or dash (no white spaces).

  • label* – Description of the task, visible to the end user on the model object Schedule page.

  • type* – What type of task is performed. Available options are:

    • post-approval-calculation – For executing a Calculation after the Model Object has been approved. If the model is not yet approved, the task will be ignored.

  • calculation – (Only for type post-approval-calculation.) Reference to the name of a Calculation defined in this Model Class.