NPE in Transition.fireSuperStateEnterEvents() when destination is null
----------------------------------------------------------------------
Key: JBPM-1716
URL:
https://jira.jboss.org/jira/browse/JBPM-1716
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.2.3
Reporter: Karl Palsson
The current method body is shown below. Destination is null in my case (I should check my
process definition, it came about from a bad database move) However, instead of getting
the JbpmException shown, I get the NPE from the "destination.isSuperStateNode()"
loop above.
I'm not entirely sure what that loop is for, which is why I've not included a
patch here. I'm unsure whether it should be moved down just past the first null
check, or to the very bottom. Sorry :(
Source in question...
Node fireSuperStateEnterEvents(ExecutionContext executionContext) {
// calculate the actual destinationNode node
Node destination = to;
while (destination.isSuperStateNode()) { ###KJP This explodes before it gets to the
Null check 3 lines down.
destination = (Node) destination.getNodes().get(0);
}
if (destination==null) {
String transitionName = (name!=null ? "'"+name+"'" :
"in node '"+from+"'");
throw new JbpmException("transition "+transitionName+" doesn't
have destination. check your processdefinition.xml");
}
// performance optimisation: check if at least there is a candidate superstate to be
entered.
if ( destination.getSuperState()!=null ) {
// collect all the superstates being left
List leavingSuperStates = collectAllSuperStates(destination, from);
// reverse the order so that events are fired from outer to inner superstates
Collections.reverse(leavingSuperStates);
// fire a superstate-enter event for all superstates being left
fireSuperStateEvents(leavingSuperStates, Event.EVENTTYPE_SUPERSTATE_ENTER,
executionContext);
}
return destination;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira