Show TOC

Background documentationStep Sequence Expression

 

With a step sequence expression, you can process several single steps of rule evaluation in a row. However, each step is assigned an entire BRFplus function and can therefore represent a significant amount of complexity.

The step sequence expression can be considered as the functional equivalent to the ruleset object type: In a ruleset, you can define a list of rules with assigned actions and conditions that are processed sequentially. The different rules can exchange data via ruleset variables. This is very similar (although not identical) to the list of functions that are used as steps to be processed sequentially in a step sequence expression. The functions can exchange data via data objects that have been assigned to the common work area of the sequence. However, the step sequence expression is even more powerful because with event mode functions, it is possible to build up a list of functions each of which has a ruleset assigned.

During processing of a single step, the context of the corresponding function is filled with values taken from the work area. The result of the single step is written back into the work area.

Features

Steps

A step sequence can have any number of functions assigned as steps, where each step corresponds to the processing of one function.

For each step, you can define an optional precondition as well as an exit condition:

  • Precondition

    If the precondition is evaluated as true, the corresponding step is process. Otherwise the step is skipped, and execution either continues with the next step in the sequence or it is terminated in case there is no subsequent step.

  • Exit Condition

    If the exit condition is evaluated as true, the result of the current function is passed to the result data object of the step sequence expression and processing of any subsequent steps is skipped. Otherwise, processing continues with the next step.

Work Area

The work area of a step sequence is a common memory area that can be accessed by all functions that have been assigned to the steps. You need to populate the work area with data objects if you want to pass parameters from one function to another. The functions can then use the data objects in the work area as a temporary memory for data exchange.

Note Note

Make sure that all data objects that you add to the work area are also included in the context of the function to which the step sequence is assigned as top expression.

You can add data objects of type element or structure to the work area. However, if you click on Add Existing Data Object, the system also offers table data objects. However, a table cannot be added as a whole, while its components (elements and structures) can.

End of the note.

The results of the single sequence steps are written to the work area. The work area is a data object of type structure. Automatic context mapping of the results of the single steps to the result data object takes place.