Versions Compared

Key

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

Model Evaluation logic is used in the following use cases:

...

  1. To provide inputs and results to be presented to the user on a

...

  1. tab when the user is browsing the model and looking at various

...

  1. tabs (of the type simple or dashboard), or looking at

...

  1. details of a tree node (on

...

  1. the tab of the type filtertree).

...

  1. When a logic from

...

  1. another module (e.g. Quotes) needs to get data from a model, it can call the model’s evaluation (and pass parameters to it)

...

  1. which will call the evaluation logic to provide the information from the model.

  2. When Product Recommendation is configured for Quotes, it can use the Model’s Evaluation (and thus the evaluation logic) to retrieve the list of recommended products.

The evaluation logic characteristics:

  • It is evaluated synchronously - e.g. immediately , when the user interacts with the UI.

  • their Its results are never persisted.

  • their Its inputs are saved with the model (in case it is used in scenario, if used while the user is browsing the model).

  • They It can do anything read only related to the Model Object where they are executed, the logic is executed; including accessing previous steps inputs, previous calculations outputs, querying Model Tables, reading attachments, etc., via the model binding.

...

The evaluation logic is referenced in the Model Class definition, in the formulaName property of:

  • a tab (only for the types dashboard, simple and filtertree);

  • an evaluation.

Logic API

To ensure that this synchronous experience is always smooth and reactive for the user : , it is a good practice is to set the elementTimeout property of all the logic elements to 0.

  • Logic Nature: model_evaluation

  • Execution Types:

    • Syntax Check - Defines the input fields of the logic. In case of Tabstabs, they will be rendered on the page, but in case of Evaluationevaluation, it will be used to receive the parameters passed from other logiclogics.

    • Standard - Calculates and provides the results.

  • Information provided to the logic:

    • Syntax Check:

      • binding Binding variables:

        • model (of type see ModelEvaluationFormulaContext) - it includes Model tableTable, inputs from previous steps and outputs from previous calculations.

    • Standard:

      • binding Binding variables:

        • model (of type see ModelEvaluationFormulaContext) - it includes Model tableTable, inputs from previous steps and outputs from previous calculations.

        • input (Map)-

          1. When used for visualizations on a

          Tab
          1. tab,

          then
          1. it contains values of all inputs provided by the user in the input fields of the current

          Tab
          1. tab.

          2. When used in

          Evaluation
          1. evaluation (from other module, via api.model().evaluate()), it contains the parameters values passed to the logic.

          2. When the evaluation is called by the Product Recommendation feature in Quotes, it will provide the following values:

            • input['categoryName'] – Specifies for which category the list of product recommendations should be returned. These categories are defined in the advanced property quoteProductRecommendationsConfig.

            • input['products'] – List of product IDs which are already present in the quote.

            • input['customers'] – List of customer IDs the quote is prepared for.

            • input['productFilter'] – Filter generated by Quote Product Picker Filter Logic, so that the evaluation can further filter the products and provide only those relevant to the user.

  • Expected logic execution outcome:

    • Syntax Check:

      • input Input field definitions placed in the logic’s logic context.

    • Standard

      the results

      :

      1. When used for visualizations on a tab – Results and their formatting are provided via the output of the visible (with DisplayMode set) logic elements

      • Critical Alert - when used on Tab, it will block the Continue button

      the
      1. . The result value can be of almost any type:

      simple:
        • Simple – String, BigDecimal, Map, List, …

      complex:
        • Complex – Chart, ResultMatrix, Controller, …

        • Critical Alert – When used on a tab, it will block the Continue button.

      1. When used in evaluation (from other module, via api.model().evaluate()) – Results are provided via the output of the visible (with DisplayMode set) logic elements.

      2. When used by the Product Recommendation feature in Quotes:

        • One element must return a result of the type List<ItemRecommendation> (see api.newItemRecommendation()).

        • When a yellow, red, or critical alert is raised, it will be presented to the user on the Quote.