Models and Model Class

, right 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.

At the very top of the page, you can edit the Model's label when you click on the EditEdit.pngicon, right after the label itself.

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.

  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:

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.

Set up Approval Workflow in Models

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

Prerequisites:

  • The Approval Workflow Package accelerator must be deployed on the partition.

Then:

  1. Configure the behavior of the Approval Workflow Package as described at https://pricefx.atlassian.net/wiki/spaces/ACCDEV/pages/3674243231.

  2. Implement a workflow logic:

    1. Create a new workflow logic of the type Model. To do that, in Pricefx Studio go to Pricefx and select Create Workflow logic.

       

    2. Add one element with the code which will call the Accelerator library to build the workflow steps. For details see 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 13.1