Finding relationship between processes

212 views
Skip to first unread message

Nicholas McRae

unread,
Mar 27, 2015, 2:52:54 PM3/27/15
to jbpm-...@googlegroups.com
Have been doing some thorough searching to find out how I can obtain parent/child processes of specific process instances. What I'm trying to do is send a notification e-mail with Java code when multiple sub-processes come together on the same gateway.

I'm working on the the following assumption:
- the remote API can't query for parent/child processes directly

Is this correct?

I've since looked into creating an event listener, but the issue is, while I can see when a sub-process has started and get its instance id, I need to map it to it's master process, and further a 'project' associated with the master process so I can e-mail the appropriate people. That brings me back to my original problem of not being able to get parent/children.

Does that make sense? Can you confirm my assumption? Are there any other avenues I can take?

Kris Verlaenen

unread,
Mar 27, 2015, 6:46:45 PM3/27/15
to Nicholas McRae, jbpm-...@googlegroups.com
Depends on which version you use.  With 6.2.0.Final, the information is already available in the ProcessinstanceLog.parentProcessInstanceId, and you can get it from REST, for example:
http://localhost:8080/jbpm-console/rest/history/instance/34
  • <process-instance-log>
  • <process-instance-id>34</process-instance-id>
  • <process-id>CallProcess.ChildProcess</process-id>
  • <start>2015-03-27T23:36:24.864+01:00</start>
  • <status>1</status>
  • <parent-process-instance-id>33</parent-process-instance-id>
  • <outcome xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
  • <identity>krisv</identity>
  • <process-version>1.0</process-version>
  • <process-name>ChildProcess</process-name>
  • <external-id>demo:CallProcess:1.0</external-id>
  • </process-instance-log>
Note that, if necessary, you can also get parent process instance information as metadata set on the process instance immediately after it was started:
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/SubProcessNodeInstance.java#L184

Kris


--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/15d55806-49c2-4903-8262-56538e8d35a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages