-
Bug
-
Resolution: Won't Do
-
Major
-
jBPM 3.2.0
-
None
Documentation does not clearly provide any limits to where conditions on Transitions can be used, but the Fork Node doesn't support Transition conditions. For instance
<fork name='FORK_1' >
<transition name='t1' to='NODE_A'>
<condition>#
</transition>
<transition name='t2' to='NODE_B'/>
</fork>
will fail with a "transition condition #{false}
evaluated to 'false'" error when the fork attempts to take transition 't1'. Why provide for this? Someone might want to:
<fork name='FORK_1' >
<transition name='startMyProject' to='...'/>
<transition name='orderEngine to='...'>
<condition>#
</condition>
</transition>
<transition name='orderWheels to='...'>
<condition>#
</condition>
</transition>
...etc...
</fork>
Correcting the issue is as simple as making the following change to org.jbpm.graph.node.Fork.java:
// BRITT --replace the following line with the code below
// to check conditions before adding valid transitions...
//transitionNames = getLeavingTransitionsMap().keySet(); //original line
Iterator iter = leavingTransitions.iterator();
while (iter.hasNext()) {
Transition candidate = (Transition) iter.next();
String conditionExpression = candidate.getCondition();
if (conditionExpression != null) {
Object result = JbpmExpressionEvaluator.evaluate(conditionExpression, executionContext);
if (Boolean.TRUE.equals(result))
}else
{ transitionNames.add(candidate.getName()); } }
if (transitionNames.size() == 0)
// --BRITT