[jboss-user] [jBPM] - Re: Is anyway to get the subprocessinstance id using the Mainprocess instance Id

saig0 do-not-reply at jboss.com
Tue Oct 9 09:00:22 EDT 2012


saig0 [https://community.jboss.org/people/saig0] created the discussion

"Re: Is anyway to get the subprocessinstance id using the Mainprocess instance Id"

To view the discussion, visit: https://community.jboss.org/message/763893#763893

--------------------------------------------------------------
Hi Shiju John,

you can not get the sub process instance id from the parent process. This relationship between process instance and sub process instance is not stored in a table. 
But you can check the class +SubProcessNodeInstance+. This class represents a sub process call activity and start the sub process instance. See the following code:

ProcessInstance processInstance = ( ProcessInstance ) ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime().startProcess(processId, parameters);
this.processInstanceId = processInstance.getId(); 
((ProcessInstanceImpl) processInstance).setMetaData("ParentProcessInstanceId", processInstance.getId()); // note: wrong process instance id


You can try to read the property +processInstanceId+  from class or build your own logic.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/763893#763893]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121009/c259c1bd/attachment.html 


More information about the jboss-user mailing list