[
https://jira.jboss.org/browse/JBPM-2818?page=com.atlassian.jira.plugin.sy...
]
Alejandro Guizar updated JBPM-2818:
-----------------------------------
Wrote test for super-state leaving transition.
Reviewed and improved super-state documentation.
Leaving node in super-state throws org.jbpm.JbpmException: cannot
leave Node without leaving transition
-------------------------------------------------------------------------------------------------------
Key: JBPM-2818
URL:
https://jira.jboss.org/browse/JBPM-2818
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Documentation, Runtime Engine
Affects Versions: jBPM 3.2.8
Reporter: Toshiya Kobayashi
Assignee: Alejandro Guizar
Fix For: jBPM 3.2.10
Attachments: JBPM-2818.patch
Original Estimate: 0 minutes
Remaining Estimate: 0 minutes
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) {
defaultTransition = auxTransition;
break;
}
}
}
else if (superState != null) {
defaultTransition = superState.getDefaultLeavingTransition();
}
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira