A Model Class is used to describe what a Model Object will look like in the UI, which logics it uses, what are their calculations, etcthe 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.
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* – Name Unique name of the Model Class, . It is used in Model Object to reference the Model Class they instantiate. It can be modified 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 userusers, when they select which Model Class they want to use for creating a new Model Object.
definition – JSON definition of what a Model Object using this Model Class should look like and how it should behave, see below.
Model Class 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, 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 is contains a JSON document that contains three has main root elements: calculations
, steps
and , evaluations
, actions
, tasks
.
Calculations (calculations
)
A list of calculation as defined by the following fields.
Common Fields
name* – Name of the calculation, unique in the Model Class.
type* – Accepted values:
formula
,sequence
.
Formula Calculation Fields
formulaName* – Unique name of an existing Formula of nature
model_calculation
, see also Model Logics.
Sequence Calculation Fields
sequence* – List of calculation names defined in this Model Class.
...
. A Calculation defines a calculation process which can be started from a Step.
Example:
Code Block | ||
---|---|---|
| ||
{ "definition": { "calculations": [ { "name": "calc1", "type": "formula", "formulaName": "POAI_Test_Calc1" }, { "name": "seq", "type": "sequence", "calculations": [ "calc2", "calc3" ] }, { "name": "calc2", "type": "formula", "formulaName": "POAI_Test_Calc2" }, { "name": "calc3", "type": "formula", "formulaName": "POAI_Test_Calc3" }, } ]{ "name": "calc4", "type": "parallel", "formulaName": "POAI_Test_ParallelCalc" } ] } |
...
A list of steps as defined by the following fields.
...
Fields:
...
name* – Name of the stepCalculation, unique in the within this Model Class.
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.
Tabs
A list of tabs as defined by the following fields.
Common Fields
name* – Name of the tab, unique in the step.
label – Human readable name of the tab, shown in the UI, it defaults to
name
if not specified.type* – Accepted values:
dashboard
,configurator
.
Dashboard Tab Fields
formulaName* – Unique name of an existing Formula of nature
model_evaluation
, see also Model Logics.
Configurator Tab Fields
formulaName* – Unique name of an existing Configurator Formula of nature
model_evaluation
, see also Model Logics and Interactive Forms - Configurators
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 logic. Used only for formula and parallel types.
For formula type – The logic must be of Nature
model_calculation
. See Model Calculation Logic.For parallel type – The logic must be of Nature
model_parallel_calculation
. See Model Parallel Calculation Logic.
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 logics.
Example:
Code Block | ||
---|---|---|
| ||
{ "definition": { "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 23 tabtabs.", "calculation": "seq", "tabs": [ { "name": "tab1", "label": "First Tab", "type": "dashboardsimple", "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" } ] } ] } |
Evaluations
A list of evaluations as defined by the following fields.
Info |
---|
See Query Optimization Engine Results to execute an evaluation from another logic. |
...
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 name of an existing logic. Depending on the field type (see above), the logic will serve different purposes, and it must be of different Natures.
For dashboard type – It must be Model Evaluation Logic which is expected to return input fields (filters) and content for portlets.
For simple type – It must be Model Evaluation Logic which is expected to return mostly simple types of values.
For configurator type – It must be Model Evaluation Configurator Logic which is expected to return the definition of form sections with input fields.
For filtertree type – It must be Model Evaluation Logic. It will be used when the user clicks a tree node, so the logic is expected to return 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.
Evaluation (evaluations
)
This is used mostly for integration of the model with other modules. When 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 of it as an API for reading the model.
Note that these Evaluations are not the same as the evaluations used to provide content for Tabs.
Example:
Code Block | ||
---|---|---|
| ||
{
"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 Formula 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 | ||
---|---|---|
| ||
{ "definitionactions": [ { "name" : "scheduled-steps", "label" : "Execute Both Steps", "type" : "steps", "fromStep": "schedule", "evaluationstoStep" : ["summary" }, { { "name" : "query_resultsscheduled-task", "label": "Execute the Scheduled Task", "formulaNametype" : "POAI_Test_QueryResultstask", "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 | ||
---|---|---|
| ||
{
"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.