[jboss-user] [JBoss jBPM] - Re: ProcessState getSubProcessDefinition is null

don_t do-not-reply at jboss.com
Tue Nov 25 17:16:09 EST 2008


I tried without late binding and got same result. However after looking at the unit test it seems the subprocess need to be set explicitly and the superprocess then persisted in the database.

  | // create the subprocess
  |     ProcessDefinition subProcessDefinition = new ProcessDefinition("sub");
  |     // store the subprocess in the database
  |     graphSession.saveProcessDefinition(subProcessDefinition);
  | 
  |     // create the super process
  |     ProcessDefinition superProcessDefinition = ProcessDefinition.parseXmlString(
  |       "<process-definition name='super'>" +
  |       "  <process-state name='subprocess' />" +
  |       "</process-definition>");
  |     // resolve the reference to the subprocess
  |     ProcessState processState = (ProcessState) superProcessDefinition.getNode("subprocess");
  |     processState.setSubProcessDefinition(subProcessDefinition);
  |   
  |     // save and reload the superprocess
  |     superProcessDefinition = saveAndReload(superProcessDefinition);
  |   
  |     processState = (ProcessState) superProcessDefinition.getNode("subprocess");
  |     assertNotNull("sub", processState.getSubProcessDefinition().getName());
  | 

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

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



More information about the jboss-user mailing list