Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-1716

NPE in Transition.fireSuperStateEnterEvents() when destination is null

XMLWordPrintable

      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;
      }

              tdiesler@redhat.com Thomas Diesler
              kpalsson Karl Palsson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: