programing languages
Version: 17.07
Supported Since: 17.07
Multi-Condition Evaluator Processing element can be used to make decisions based on pre-specified conditions. The behaviour of this element is analogous to the IF-THEN / ELSE conditional statement in high level programing languages. This is an extended version of the Conditions Evaluator
If-Then Output |
The message will be emitted from this outport if the expression specified in the element evaluates to |
Else Output |
The message will be emitted from this outport if the expression specified in the element evaluates to |
On Exception |
The message will be sent to this outport if any exception occurred while processing |
Expression * |
Basic |
This is the basic expression, which is evaluated by the processing element.
|
In the following use case, a Multi-Condition Evaluator is used to check a transport header and a scope variable in the message recieved from an HTTP Client. If the transport header is LEGACY and the scope variable AGE is 25 then the message will be sent to a particular HTTP backend and if the whole condition is not satisfied, the message will be sent to another HTTP backend.
As shown in the below diagram, let’s build our basic flow.
As for the properties of the Conditions evaluator, specify the expression as
(*String$H.MSG_ROUTING$equals$LEGACY*) AND (*Integer$V.AGE$equals$25*)
Now if you run the project and send a message with HTTP Transport header MSG_ROUTING with value LEGACY and the scope variable AGE with value 25, that message will be sent via Egress Connector (a) and for any other message which does not satisfy the given expression, the message will be sent via Egress Connector (b)