[jboss-user] [JBoss jBPM] - Process-state: can't create a process instance when processD

ayang do-not-reply at jboss.com
Fri Oct 27 14:43:58 EDT 2006


I'm trying a very simple example of sub-processes up and running with the following definitions:


  | <process-definition xmlns="urn:jbpm.org:jpdl-3.1"  name="sub">
  |    <start-state name="start">
  |       <transition name="" to="node"></transition>
  |    </start-state>
  |    <node name="node">
  |       <transition name="" to="wait-state"></transition>
  |    </node>
  |    <end-state name="end"></end-state>
  |    <state name="wait-state">
  |       <transition name="" to="end"></transition>
  |    </state>
  | </process-definition>
  | 

  | <process-definition  xmlns="urn:jbpm.org:jpdl-3.1"  name="caller">
  |    <start-state name="start">
  |       <transition name="" to="node"></transition>
  |    </start-state>
  |    <end-state name="end"></end-state>
  |    <node name="node">
  |       <transition name="" to="call sub"></transition>
  |    </node>
  |    <process-state name="call sub">
  |    	  <sub-process name="sub"/>
  |       <transition name="" to="end"></transition>
  |    </process-state>
  | </process-definition>
  | 
Excerpted from my unit test code:


  | 	context = _jbpmConfiguration.createJbpmContext();
  | 
  | 	FileInputStream fis_sub = new FileInputStream("processes/sub/processdefinition.xml");
  | 	FileInputStream fis_caller = new FileInputStream("processes/caller/processdefinition.xml");
  | 			
  | 	ProcessDefinition pdload_sub = ProcessDefinition.parseXmlInputStream(fis_sub);
  | 	ProcessDefinition pdload_caller = ProcessDefinition.parseXmlInputStream(fis_caller);
  | 
  | 	context.deployProcessDefinition(pdload_sub);
  | 	context.deployProcessDefinition(pdload_caller);
  | 
  | 	GraphSession gs_caller = context.getGraphSession();
  | 
  | 	// don't think I necessarily need to reload the process definitions 
  | 	// from the session but it doesn't make a difference
  | 	ProcessDefinition pd_sub = gs_caller.findLatestProcessDefinition("sub");
  | 	ProcessDefinition pd_caller = gs_caller.findLatestProcessDefinition("caller");
  | 
  | 	ProcessInstance inst = new ProcessInstance(pd_caller);
  | 			
  | 	// begin
  | 	Token token = inst.getRootToken();
  | 	ContextInstance contextInst = (ContextInstance) inst.getInstance(ContextInstance.class);
  | 
  | 	System.out.println("getNode().getName(): " + token.getNode().getName());
  | 			
  | 	token.signal();
  | 	System.out.println("getNode().getName(): " + token.getNode().getName());
  | 	}
  | 	finally
  | 	{
  | 		context.close();
  | 	}
  | 
The process runs successfully until it tries to invoke the sub-process (when I signal the calling process) at which point I get the NullPointerException

I'm sure it's something very simple - any thoughts?

Thanks,
Andy

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981392#3981392

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981392



More information about the jboss-user mailing list