3 Replies Latest reply on Apr 24, 2008 5:46 PM by Milo Chanzy

    Can't create a process instance when processDefinition is nu

    Milo Chanzy Newbie

      Hi,

      I have a sub-process invoked by a main process. I am using Eclipse for running the application. What I have done is started the jBPM server and deployed the main and sub processes using the 'deployment' tab of the processdefinition.xml. I am creating the instance of the main process. It runs to the point where the next node is a process-state whose sub-process is defined. I am getting following error:


      org.jbpm.JbpmException: can't create a process instance when processDefinition is null
      at org.jbpm.graph.exe.ProcessInstance.<init>(ProcessInstance.java:128)
      at org.jbpm.graph.exe.ProcessInstance.<init>(ProcessInstance.java:92)
      at org.jbpm.graph.exe.Token.createSubProcessInstance(Token.java:624)
      at org.jbpm.graph.node.ProcessState.execute(ProcessState.java:164)
      at org.jbpm.graph.def.Node.enter(Node.java:319)
      at org.jbpm.graph.def.Transition.take(Transition.java:151)
      at org.jbpm.graph.def.Node.leave(Node.java:394)
      at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
      at org.jbpm.graph.node.Decision.execute(Decision.java:152)
      at org.jbpm.graph.def.Node.enter(Node.java:319)
      at org.jbpm.graph.def.Transition.take(Transition.java:151)
      at org.jbpm.graph.def.Node.leave(Node.java:394)
      at org.jbpm.graph.def.Node.leave(Node.java:358)
      at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:120)


      Following are the code parts:

      main process: ( not the exact code, but sumarizes all I have done)
      String temp = content of main processdefinition.xml;
      ProcessDefinition main = ProcessDefinition.parseXmlString(temp);
      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      while(processInstance.hasEnded() == false) {
       processInstance.signal();
      }