[jboss-user] [JBoss jBPM] - Re: Transient variables between process and subprocess
nizzy
do-not-reply at jboss.com
Wed Sep 3 11:21:24 EDT 2008
Hi Guys,
I know this was a long time ago, but I'm trying to access a super-process transient variables via a sub-process.
In an ActionHandler I extract the transient variable map. When in the super-process the map contains the expected variables, however the sub-process map is null.
Is there anything special I need to do, have done, so that the
| subContextInstance.setTransientVariables(superContextInstance.getTransientVariables());
|
line of code in ProcessState is executed?
Currently all I'm doing is using the super-process to find the sub-process and signalling the sub-process.
public void signalSubProcess(long processInstanceId, String transitionName) {
| log.info("Signalling Sub Process");
|
| // Find ProcessInstance
| JbpmContext ctx = JbpmConfiguration.getInstance().createJbpmContext();
| try {
| GraphSession gs = ctx.getGraphSession();
| gs.lockProcessInstance(processInstanceId);
|
| ProcessInstance instance = ctx.getProcessInstanceForUpdate(processInstanceId);
| log.info("Root Token of instance is " + instance.getRootToken().getId());
|
| ProcessInstance subInstance = instance.getRootToken().getSubProcessInstance();
| if (instance.hasEnded()) {
| log.info("SubProcess Instance has already ended so cannot signal");
| }
|
| if (subInstance != null) {
| signal(subInstance, transitionName);
| } else {
| String msg = "ProcessInstance not found";
| log.info(msg);
| throw new RuntimeException(msg);
| }
|
| } finally {
| ctx.close();
| }
| }
Am I calling the sub-process incorrectly, and as a result not executing the code included in the ProcessState class?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173988#4173988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173988
More information about the jboss-user
mailing list