4 Replies Latest reply on Mar 8, 2007 6:50 PM by dohoangn

    Problem with process composition

    nicolemans72

      I have a problem with my process composition.

      I have a sub-process like that:

      <process-state name="process1">
       <sub-process name="implementation" />
       <variable name="crStatut" access="read,write" mapped-name="crStatut" />
       <variable name="crId" access="read,write" mapped-name="crId" />
       <transition name="Validation" to="statut 90"></transition>
      </process-state>
      


      and when the process arrive to the "Process State" I hava an error

      java.lang.NullPointerException: can't create a process instance when processDefinition is null
       at org.jbpm.graph.exe.ProcessInstance.<init>(ProcessInstance.java:87)
       at org.jbpm.graph.exe.Token.createSubProcessInstance(Token.java:571)
       at org.jbpm.graph.node.ProcessState.execute(ProcessState.java:109)
       at org.jbpm.graph.def.Node.enter(Node.java:316)
      


      However, i have deployed the processimplementation and there is a process definition in the database

      Any suggestions?

        • 1. Re: Problem with process composition
          dennys

           

          "nicolemans72" wrote:
          I have a problem with my process composition.

          I have a sub-process like that:

          <process-state name="process1">
           <sub-process name="implementation" />
           <variable name="crStatut" access="read,write" mapped-name="crStatut" />
           <variable name="crId" access="read,write" mapped-name="crId" />
           <transition name="Validation" to="statut 90"></transition>
          </process-state>
          


          and when the process arrive to the "Process State" I hava an error

          java.lang.NullPointerException: can't create a process instance when processDefinition is null
           at org.jbpm.graph.exe.ProcessInstance.<init>(ProcessInstance.java:87)
           at org.jbpm.graph.exe.Token.createSubProcessInstance(Token.java:571)
           at org.jbpm.graph.node.ProcessState.execute(ProcessState.java:109)
           at org.jbpm.graph.def.Node.enter(Node.java:316)
          


          However, i have deployed the processimplementation and there is a process definition in the database

          Any suggestions?



          Hay nicolemans72!

          JBPM_PROCESSDEFINITION table it must possess one process definition with name "implementation".


          Bye!

          • 2. Re: Problem with process composition
            dohoangn

            I have the same problem even I already have deployed sub processs and the sub process name is in the table jbpm_processdefinition. Could you please give us a solution?
            Thanks,

            • 3. Re: Problem with process composition
              dohoangn

              I found the problem:

              This is my main process:

              <?xml version="1.0" encoding="UTF-8"?>

              <process-definition
              xmlns="urn:jbpm.org:jpdl-3.1" name="main">
              <start-state name="start">

              </start-state>
              <end-state name="end"></end-state>
              <process-state name="sub">
              <sub-process name="sub"/>

              </process-state>
              </process-definition>

              This is my sub process:

              <?xml version="1.0" encoding="UTF-8"?>

              <process-definition
              xmlns="urn:jbpm.org:jpdl-3.1" name="sub">
              <start-state name="start">

              </start-state>
              <end-state name="end"></end-state>



              </process-definition>

              When I deploy the sub process and main process:

              public void deployProcessDefinition() {
              // / Extract a process definition from the processdefinition.xml
              // file.
              ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("main/processdefinition.xml");
              assertNotNull("Definition should not be null", processDefinition);

              // Create an instance of the process definition.
              ProcessInstance instance = new ProcessInstance(processDefinition);
              JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
              try {
              // Deploy the process definition in the database
              jbpmContext.deployProcessDefinition(processDefinition);

              } finally {
              // Tear down the pojo persistence context.
              // This includes flush the SQL for inserting the process
              // definition
              // to the database.
              jbpmContext.close();
              }
              }

              It adds new records in all neccessary tables but it did not insert the sub process definition id (subprocessdefinition_)
              into table jbpm_node, after I manually insert this id, it works

              How could we fix this bug?
              Thanks,

              • 4. Re: Problem with process composition
                dohoangn