is it possible to evaluate a condition of a SequenceFlow using, for example, an ExecutionListener or something similar? I.e. can the evaluation be delegated to custom Java code?
Kind regards,
Stefan
Our use case: We have a custom expression language, which we'd like to use for conditions. Of course, those expressions can't be evaluated using Java UEL or any other built-in mechanism.
Consider the following SequenceFlow:
<sequenceFlow id="SeqFlow_1" name="" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_1">
<conditionExpression>CUSTOM EXPRESSION</conditionExpression>
</sequenceFlow>
When the gateway in the example above starts evaluating the conditions of the different outgoing sequence flows to decide which path to take, it would be helpful to have some callback mechanism to evaluate the custom expression, for example:
interface ConditionListener {
boolean evaluateCondition(String theConditionExpression);
}
Let a class implement the interface:
public class MyCustomEvaluator implements ConditionListener {
...
}
And then hook the class into the expression:
<conditionExpression class="my.package.MyCustomEvaluator">CUSTOM EXPRESSION</conditionExpression>
Maybe I can use the scripting approach, but a mechanism like the one just described would be (a lot) more convenient... :-)
Stefan
I implemented the two interfaces of the JSR and everything works nicely.
Stefan