Understanding Execution Modes
Every scenario execution initiated by Xpress Insight has an associated execution mode.
Execution modes are defined in models using Mosel annotations - when the model is run, it can test for the execution mode and make predicate-based decisions.
Every app is assigned (and must implement behavior for) two standard execution modes -
LOAD and
RUN - they have constants associated with them in the model:
- INSIGHT_MODE_LOAD
- INSIGHT_MODE_RUN
These are used in a case statement in the example project to switch branching logic via the execution mode - in this case, to either load input data or populate Xpress Insight.
A model can also define any number of additional custom execution modes - they can offer your app two additional forms of control:
- Executing different model code paths based on the execution mode selected by a user.
- Routing different kinds of Xpress Insight jobs to different worker resources configured on the server. For example, you could have a model that performs small, fast jobs as well as large, slow jobs. Using custom execution modes, you can route the two different kinds of jobs to the worker resources best equipped to serve them.