The model calculation logic is meant for model calculations – usually long running calculations, data crunching, data preparation, wrangling, machine learning, AI optimization, etc. As they can take long, they are executed asynchronously.
The model calculation logic is executed at the beginning of a step, i.e. when the user:
Opens the first step of the Model on the Model Detail page.
orNavigates to the next step of the Model.
It is always executed before the tabs of the step are evaluated.
This logic’s output is provided in the form of:
Model Tables (kind of Datamart tables and lookup tables). Intended to store big data quantities.
Logic results. They are persisted to the database and are not meant to hold big quantities of information (that is what Model Tables are for).
Configuration
Calculation logics are used/referenced 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.
Logic API
Logic Nature:
model_calculation
Execution Types:
Standard – Calculates (e.g., produces data in Model Tables) based on the previous steps inputs and previous calculations outputs.
Information provided to the logic:
binding variables
model
(of the type ModelCalculationFormulaContext, see its API to understand its usage). It includes, for example:Model tables
Inputs from previous steps tabs
Outputs from previous steps' calculations and from their tabs' calculations
Common Logic Actions:
Create model tables
Read from / write to the model tables
Call some Engines, using Job Trigger Calculations
Generally
Anything read and write related to the Model Object where they are executed
Everything that can be done with Evaluation Logics
Expected logic execution outcome:
Return simple information via the output of the visible logic elements. This will be saved to the model.