-
Bug
-
Resolution: Done
-
Major
-
jBPM 3.2.8
-
None
Leaving <node> in <super-state> throws
org.jbpm.JbpmException: cannot leave Node(node2) without leaving transition
when I execute process definition like:
================
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="id41">
<start-state name="start">
<transition to="super-state1"></transition>
</start-state>
<super-state name="super-state1">
<transition to="end"></transition>
<node name="node1">
<transition to="node2"></transition>
</node>
<node name="node2">
</node>
</super-state>
<end-state name="end">
</end-state>
</process-definition>
=================
Note: <node name="node2"> doesn't have its own transition. but I expect super-state's transition is available then.
The process definition works if you test via ProcessDefinition.parseXmlResource(String xmlResource) without DB/Hibernate (like org.jbpm.graph.exe.SuperStateActionExecutionTest.testNestedSuperStateLeaveViaSuperStateTransition()).
What's the difference?
org.jbpm.graph.def.Node:
=========
public Transition getDefaultLeavingTransition() {
Transition defaultTransition = null;
if (leavingTransitions != null) {
// Select the first unconditional transition
for (Iterator i = leavingTransitions.iterator(); i.hasNext() {
Transition auxTransition = (Transition) i.next();
if (auxTransition.getCondition() == null)
}
}
else if (superState != null)
return defaultTransition;
}
=========
The logic of getDefaultLeavingTransition() depends on whether leavingTransitions is null or not. But in case that hibernate kicks lazy initialization, leavingTransitions will be a zero sized collection, not null.
BTW, I think the concept that super-state's transition can be chosen from nodes inside is better to be documented.