__Model Logics

In a Model Class, two types of logics can be used: evaluation logics and calculations logics.

Evaluation Logics

Evaluation logics are used in tabs and configurators, they are always used in a given step and a given tab, as declared in the Model Class.

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

Those logics are made to be evaluated synchronously when the user interacts with the UI, their results are never persisted but their inputs are saved with the model. To ensure that this synchronous experience is always smooth and reactive for the user : a good practice is to set the elementTimeout property of all the logic elements to 0.

Evaluation Logic API

Calculation Logics

Calculation logics are used in model calculations, they are always used in a given step as declared in the Model Class and executed at the beginning of the step, that is before any of the tabs of the same step could be evaluated.

They can do anything read and write related to the Model Object where they are executed, including everything that can be done with Evaluation Logics as well as writing Model Tables, starting new Job Trigger Calculations, etc., via the model binding.

Those logics are meant to be executed asynchronously for potentially long running calculations, data crunching, data preparation, wrangling, machine learning, AI optimization, etc. Their outputs are in the form of Model Tables and logic results. The logic results are persisted to the database and are not meant to hold big quantities of information (that is what Model Tables are for).

There are two natures of logics for formula-based model calculations: simple calculation or parallel calculation.

Simple Calculation

  • Expected logic execution outcome:

    • Building Model Tables, starting new Job Trigger Calculations, returning simple information as logic results.

Parallel Calculation

These calculations are executed in a 3-step fashion and are mainly used to implement use cases where it is required to calculate many independent items in parallel. In practice, those items are calculated in a distributed manner (see also Distributed Calculation).

See Build and Use Parallel Calculation for a simple procedure on writing and using such logics.

Found an issue in documentation? Write to us.