[rules-users] How to find ALL active sub/processes for a root process instance?

tolitius webakaunt at gmail.com
Fri May 14 16:37:02 EDT 2010


Having several active processes ( parent + its subprocesses + subprocesses of
the parent subproccesses ):

mysql> select InstanceId, processId, state from processinstanceinfo;
+------------+--------------------------------+-------+
| InstanceId  |        processId                         |  state |
+------------+--------------------------------+-------+
|               1 |    main-flow                             |       1 |
|               2 |    first-level-subprocess-flow      |       1 |
|               3 |    second-level-subprocess-flow  |       1 |
+------------+--------------------------------+-------+

Having a parent process instance ID, how to programmatically (using the out
of the box framework capabilities) find all _active_ subprocesses? [ of all
levels, e.g. including subprocesses of the parent subprocesses ]?

I would think that the answer is:

		StatefulKnowledgeSession session =
knowledgeProvider.loadStatefulKnowledgeSession( sessionId );
		
		WorkflowProcessInstance parentProcess = ( WorkflowProcessInstance )
session.getProcessInstance( processInstanceId );
		
		for ( NodeInstance node : parentProcess.getNodeInstances() ) {
                                  .... ... ...
		}

But no, it only returns a one level of subprocesses.

So two(2) questions here:

    1. How to programmatically, using OTB framework features get them?
    2. Why does not processInstance"Info" have "Info" about a sub process,
like a PARENT_ID?


Thank you,
/Anatoly
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-find-ALL-active-sub-processes-for-a-root-process-instance-tp818268p818268.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list