[jboss-user] [JBoss jBPM] - Can I get to the parent process, given a sub-process?

avbentem do-not-reply at jboss.com
Thu Mar 22 11:30:55 EDT 2007


Sorry, probably simple but I cannot figger it out...

Can I, given a task in a sub-process, find it's calling <process-state>? 

Looking in the debugger (the process being started through Seam and the taskInstance and processInstance also injected by Seam) I get many null values, such as: 

taskInstance.token.parent == null
taskInstance.token.isAbleToReactiveParent == true
processInstance.rootToken == null
processInstance.superProcessToken == null

Of course, I can write a query to get it from the database myself (I actually only need read-access). I wonder why table JBPM_TOKEN has NULL in column PARENT_ (jBPM 3.1.4; might simply be obsolete), but the parent token does in fact link to its (active) child using  column SUBPROCESSINSTANCE_. In table JPBM_PROCESSINSTANCE the sub process refers to the parent using column SUPERPROCESSTOKEN_. So, surely doable.

I don't think the definition is important, but it's something like:

<?xml version="1.0" encoding="UTF-8"?>
  | <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="my-process">
  |    <start-state name="Start">
  |       <transition name="start" to="MySubProcess" />
  |    </start-state>
  | 
  |    <process-state name="MySubProcess">
  |       <sub-process name="my-sub-process" binding="late"/>  
  |       <transition name="end" to="End" />
  |    </process-state>
  | 
  |    <end-state name="End" />
  | </process-definition>

<?xml version="1.0" encoding="UTF-8"?>
  | <process-definition xmlns="" name="my-sub-process">
  |    <start-state name="Start survey">
  |       <transition name="" to="survey" />
  |    </start-state>
  | 
  |    <task-node name="task1">
  |       <task name="task1">
  |          ...
  |       </task>
  |       <transition name="done" to="End" />
  |    </task-node>
  | 
  |    <end-state name="End" />
  | </process-definition>

Thanks,
Arjan.

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

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



More information about the jboss-user mailing list