[jbpm-issues] [JBoss JIRA] Created: (JBPM-1686) NPE when reading a process definition with a decision name which contains the "/" character

Julien Kronegg (JIRA) jira-events at lists.jboss.org
Mon Aug 18 08:30:58 EDT 2008


NPE when reading a process definition with a decision name which contains the "/" character
-------------------------------------------------------------------------------------------

                 Key: JBPM-1686
                 URL: https://jira.jboss.org/jira/browse/JBPM-1686
             Project: JBoss jBPM
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: jPDL 3.2.2
         Environment: JDK1.6.0, Eclipse 3.3
            Reporter: Julien Kronegg
            Priority: Minor


When a process definition is read and when it contains a decision named with a "/" character, a NullPointerException is raised:

	import org.jbpm.graph.def.ProcessDefinition;
	public class TestDecisionNPE {
		  public static final void main(String[] args){
			    ProcessDefinition.parseXmlString(
			      "<process-definition>" +
			      "  <start-state>" +
			      "    <transition to='d/e' />" +
			      "  </start-state>" +      
			      "  <decision name='d/e'>" +
			      "    <transition name='one' to='a'>" +
			      "      <condition>#{a == 1}</condition>" +
			      "    </transition>" +
			      "    <transition name='three' to='c'>" +
			      "      <condition>#{a == 3}</condition>" +
			      "    </transition>" +
			      "  </decision>" +
			      "  <state name='a' />" +
			      "  <state name='c' />" +      
			      "</process-definition>");
			  }
	}

raises:

GRAVE: couldn't parse process definition
java.lang.NullPointerException
	at org.jbpm.graph.def.ProcessDefinition.findNode(ProcessDefinition.java:345)
	at org.jbpm.graph.def.ProcessDefinition.findNode(ProcessDefinition.java:299)
	at org.jbpm.jpdl.xml.JpdlXmlReader.resolveTransitionDestination(JpdlXmlReader.java:774)
	at org.jbpm.jpdl.xml.JpdlXmlReader.resolveTransitionDestinations(JpdlXmlReader.java:740)
	at org.jbpm.jpdl.xml.JpdlXmlReader.resolveTransitionDestinations(JpdlXmlReader.java:732)
	at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:162)
	at org.jbpm.graph.def.ProcessDefinition.parseXmlString(ProcessDefinition.java:151)
	at test.TestDecisionNPE.main(TestDecisionNPE.java:7)
Exception in thread "main" org.jbpm.jpdl.JpdlException: [[ERROR] couldn't parse process definition]
	at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:172)
	at org.jbpm.graph.def.ProcessDefinition.parseXmlString(ProcessDefinition.java:151)
	at test.TestDecisionNPE.main(TestDecisionNPE.java:7)

This is due to a "node = nodeCollection.getNode(namePart);" in ProcessDefinition.findNode(): a Decision has no nodes, so the nodeCollection is null.

It should be :
1. a more descriptive exception message, such as "could not get the node with name XXX"
2. a validation step which prevent the node name to contain "/" characters, e.g. throw an exception "the node name cannot contain a "/" character"

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

        



More information about the jbpm-issues mailing list