Control Model Operation

Navigation:  Decisions > Decision Server Control Model > Populate the control decision model >

Control Model Operation

Previous pageReturn to chapter overviewNext page

 

There are some other key aspects of the operation of the control model that are not illustrated fully in the example worked through above, but are important.

Control Model Execution

Each “pass” through the control model represents one iteration of the control model. The purpose of each iteration is to provide an instruction for the control model to execute at the completion of the iteration (i.e. the Repository Name and the Decision Model Name for the next model to be executed). The execution of the model defined takes place after the iteration through the control model is complete – not during the iteration. Hence the execution of the next model defined by the control model can be thought of as taking place “outside” the control model, as opposed to “within” the control model.

This means that each iteration of the control model can lead to the invocation of only one standard model. If more than one standard model is defined as the next model to be invoked within one iteration, then this is a modelling error and in this circumstance the last defined model will be the one that is invoked at the end of the iteration. The execution of a standard model at the end of an iteration is also the time that this model name is written to the collection of previous decision models. Note that the name of the next decision model (repository and decision model) is retained and not automatically reset (set to empty) at the end of the iteration - hence the need to create a specific decision and formula to reset the next model name to empty in the example illustrated above. Therefore unless the next decision model name is set to a different model name during the next iteration the same decision model will be executed at the end of the next iteration also.

Control Model Termination

The control model will continue to iterate until it is told to stop. The method that would normally be used to stop the iterations of the control model, is for the control model to declare that it has completed all the invocations of the standard decision models that are required. To terminate the control model in this manner the next decision model name is set to an empty string (e.g. “”) instead of a decision model name. Hence it is important to have this empty string setting in the decisions and formulas that set the next decision model name in the control model. The control model will not terminate through operations that terminate processing within a decision model (e.g. the ‘ExitDecisionGroup’ operator).

A ‘failsafe’ mechanism for terminating the execution of the control model is also provided by the ‘@MaximumIterations’ node on the ‘TransactionControl’ schema. The control model will terminate when the number of iterations specified here have been completed. This value can be set via a decision and formula in the control decision model. The default value for ‘@MaximumIterations” is 50.

Control Model Invocation

A control model can only call standard decision models – it cannot call another control decision model. Similarly standard decision models can only be called from a control decision model – they cannot be called from other standard decision models, as the Transaction Control schema cannot be attached to a standard decision model.

Hence a ‘nested sequence’ of decision models cannot be called, as neither of the above configurations are supported.

It is valid for a particular standard decision model to be called once, more than once, or not at all during the processing performed by a control model. Each individual call will be captured as a separate instance in the previous decision models collection, so therefore a particular decision model can appear more than once in that collection.

Control Model Approaches

The use of the control model illustrated above in the ‘Vehicle Insurance Control’ example can be regarded as a generic approach to the use of the control model. Other approaches can be defined to suit specific business scenarios. For instance, if a pre-defined set of ‘specialist’ models always need to be run in a specified order, then all business logic tests can be removed from the control model (i.e. the tests for the presence of young drivers and claims in the example illustrated above). One way to achieve this is to simply list them in a table with last model/next model columns and the formulas setting the next model simply walk through the table.        

The generic approach illustrated is recommended as a standard approach for the first version of a control model, and then it can be refined if necessary to best serve specific business requirements.