State Evaluator
Description
This unit is a Processor unit.
It is used to coordinate the joint activity of a subset of units of a flow. It has a set of states and rules. These rules allow changing the state according to the reception of events or the evaluation of certain expressions.
The rules are added in the unit configuration. The states are not listed explicitly; they are inferred of the ones that participate in the rules. The rules may also be used to define the unit input ports (which activate the rules) and output ports (which notify the activation of the rules).
The rules have antecedents and consequents:
The antecedents may be the following: the unit is in a certain state, a new event arrives (optional), or certain conditions are satisfied (optional).
The consequents may be the following: changing to a different state or emitting an event through an output port (optional).
When the unit finds active rules, it chooses the first more complex one, emits an event through an output port (if it has one), and changes to the destination state. The rules are evaluated in a specific order: a rule with a test is more complex than another one without a test.
A rule can be fired after the unit consumes multiple events. Even if the rules consume only some of them, the rule fired will consume only one.
Every time an event is emitted, it can be enriched with the following information:
Date when the rule fired.
Date of the initial state of the rule.
Date of the destination state of the rule.
Configuration
After dragging this unit into the Flow canvas, double-click it to access its configuration options. The following table describes the configuration options of this unit:
Tab | Field | Description |
---|---|---|
General | Name | Enter a name for the unit. It must start with a letter, and cannot contain spaces. Only letters, numbers, and underscores are allowed. |
Description | Enter a description detailing the scope of the unit. | |
Polling time interval | Time for the polling interval (in milliseconds). | |
Language | Language in which expressions/statements are written. | |
Initial state | The initial state of the execution. If it is blank, the default value will be __INITIAL__ | |
Rule name field | The name of the field that would contain the rule name in the output events, if any output port is defined. | |
From state name field | The name of the field that would contain the previous state in the output events, if any output port is defined. | |
To state name field | The name of the field that would contain the next state in the output events, if any output port is defined. | |
Rules Click the + icon to add rules as required. Each rule has the parameters described next to this. You can also reorder the fields using drag and drop. | Name | Enter a unique name for the rule. |
When | Enter the details for the rule antecedent:
| |
Trigger | Enter the details for the rule consequent:
|
Input ports
You can optionally add input ports to this unit if required. Ports are added through the creation of rules. See more info above.
Output ports
You can optionally add output ports to this unit if required. Ports are added through the creation of rules. See more info above.