Models and Model Class

A Model Object (MO) is an instance of a Model Class which defines its structure and behavior.

Model Object Window

The main Model Object window allows the user to configure Model Object, display its results and compute all steps it consists of. Depending on its Model Class, the number of steps and their content varies.

Typical configuration of a Model Object consists of a sequence of parameters setting and runs of each steps. For example, a Model Object that simulates an effect on a price change may typically contain 3 steps:

  1. Scope – Users can select the scope of the simulation (product families, customer categories, time range, etc.). In this step users can also visualize some statistics about the selected scope.

  2. Simulation – Users can set up the simulation parameters (price variation rates, cost variations, etc.).

  3. Results – The simulation itself is done and the user gets the results visualization.

Each step can also contain one or more tabs that help configure and/or visualize different aspects of the step (e.g. one tab for configuring the customer parameters and another for the products).

The following figure highlights the main components which can be displayed in the Model Object window.

model_object_ui.png
  1. Stepper – Allows you to navigate through already calculated steps. Right-clicking the step name opens the browser context menu and allows you to open the step in a new tab or window.

  2. Tab selector – Displays the different tabs of the current step.

  3. Tab configurator – Allows you to configure the current tab.

  4. Apply Settings button – Applies the parameters and refreshes the dashboard (5).

  5. Dashboard – Displays results related to the current step. Each tab contains its own dashboard.

  6. Continue button – Once all the required parameters are correctly set up in all tabs of the current step, clicking Continue triggers the calculation of the next step and switches to it.

  7. General actions buttons:

    • Recalculate – Triggers the calculation of the current step. (You can also configure that certain steps will be recalculated regularly.)

    • Save – Saves explicitly the current state of the model. Note that clicking Continue also saves the state of the Model Object.

    • Three-dots – Displays additional actions:

      • Attachments – Allows you to upload, download or delete file attachments to the Model Object.

      • Job Tracking – Displays the status of the calculations triggered by the user.

      • Tables – Allows you to display, download or delete associated Model Tables.

      • Schedules – Allows you to schedule calculation of the model. It is either one-off run or it runs periodically according to the defined frequency.

Available Actions

To work with a Model Object, you use the following actions:

  • Import & Export – Exports the selected Model Object via the Download (zip) button. It creates an archive containing a JSON file representing the Model Object and its fields. This export does not contain the associated objects such as the model tables or the attached files. The list of the fields is detailed in https://pricefx.atlassian.net/wiki/spaces/KB/pages/3862691915/Model+Object+MO#Fields.

    ModelsAndClasses02.png

    This archive can then be imported as-is and given a new name and label to create the corresponding Model Object. Note that if you import a Model Object on a different partition, you need to ensure that its Model Class is available.

  • Copy – You can copy a Model Object by using the Duplicate button. It will create a new Model Object initialized with the same state as the current one. Like with the Import feature, the Model Tables and attached objects are not copied.

    You have to specify a new Name and a Model Class, as well as an optional label to finish the copy.

    Once the Model Object is copied, it is automatically opened and computes its first step.

  • Revoke – Allows you to revoke an approved model (which is then read-only and not deletable). This action sets the workflow status of the model to Withdrawn. Available only to users with the roles Administer Model Classes/Objects or Manage Model Objects.

  • Set up user access – Models inherit permissions from their Model Class, but the permissions can be restricted on the model level: you can define which user groups are entitled to view/edit the model – using the fields User Group (View Details) and User Group (Edit). Parameter tables created by the model inherit these group permissions set for the model.
    A comprehensive overview of Model Class and Models permissions is available in Module Categories.

Models Read-Only Mode

Depending on the Model Object state, the model can be either editable or in read-only mode.

Contrary to editable mode, in read-only mode:

  • All fields are greyed and cannot be modified (as shown below).

  • Model Object Parameter tables and Attachments are also not editable.

A Model Object is in read-only mode when:

  • A calculation is being run.

  • The model has been submitted and approval is pending.

  • The model is approved or no approval is required.

Approval Workflows

In order to be used by other parts of the system, a Model Object can be approved. The approval process uses the standard Pricefx workflow mechanism.

Setup an Approval Workflow in Models

The approval mechanism can be enabled by configuring a workflow logic in the Model Class of the model, else it is disabled.

There are prerequisites to use the approval workflow. The Approval Workflow Package accelerator must be deployed on the partition.

Then:

  • Add one element with the code which will call the Accelerator library to build the workflow steps. More info https://pricefx.atlassian.net/wiki/spaces/ACCDEV/pages/3684040871

    • Sample code :

      if (api.isInputGenerationExecution()) return Map modelObject = api.find("MO", 0, 1, null, Filter.equal("uniqueName", model.uniqueName())).first() libs.ApprovalWorkflow.ApprovalWorkflow .getApprovalWorkflow("Model", workflow, modelObject)

Use the Approval Workflow

Once all the Model Object steps have been properly configured and run, the user can initiate the approval by clicking the Submit for Approval button.

  • Depending on the configured workflow logic, several users may be notified about the pending approval.

  • A submitted or approved model automatically switches to the read-only mode. It must be denied or withdrawn to switch back to read/write mode.

Parameter Tables

Model Object Parameters Tables are a special kind of Company Parameters owned by a model.

  • They may be initialized, written or read by Model steps calculations.

  • The user can also read those tables or write in them from the Model Object user interface (as shown below).

  • The tables inherit the “User Group (View Details)” and “User Group (Edit)” settings defined for their model.

To edit Model Object Parameters Tables:

  1. Click the three-dots button at the top right of the window.

  2. Select Tables.

  3. Click the Parameter Tables tab.

  4. Select the table to be displayed/edited.

  5. The content of the selected table is displayed and can be edited on the right side of the window.

Found an issue in documentation? Write to us.

 
Pricefx version 12.0