Conditional Transitions
A conditional (guarded) transition follows the same syntax as a simple transition, but allows a Rule tag inside the Transition tag.
The content of the Condition tag will be evaluated using the Bean Shell Java interpreter, and the result will be used to determine if the transition is valid or not.
Tag | Semantics | Signature | Valid Values |
---|---|---|---|
Rule | The Rule tag encloses a set of in parameter tags, a single out parameter tag, and a condition tag. |
<Rule>…</Rule> |
Parameter and Condition tags. |
Condition | Specifies a condition which must assign a boolean object to the special internal variable ‘result’, indicating whether or not this transition can be fired. |
<Condition> #CDATA </Condition> |
The condition expression must be a valid Java statement or a valid JAVA method call, which has a net result of assigning a boolean object to the special variable ‘result’. |
Format | This is an attribute of the Condition tag. |
<Condition format=<format>> #CDATA </Condition> |
bsh
java (version 7.1 onwards) |
Parameter | Input arguments passed to the condition. |
The parameters of a guarded transition specify input variables that can be used inside the bean shell expression. The WorkFlowManager uses the parameter attribute ‘name’ as the name of the variable in the scope of the bean shell. A guarded transition can have any number of input variables, but is required to have only one output variable, which must be named result.
Copyright © Cloud Software Group, Inc. All rights reserved.