[jbpm-commits] JBoss JBPM SVN: r6708 - jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/node.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Sep 30 09:44:19 EDT 2010


Author: bradsdavis
Date: 2010-09-30 09:44:18 -0400 (Thu, 30 Sep 2010)
New Revision: 6708

Modified:
   jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/node/ProcessState.java
Log:
Added asynchronous start to the subprocess state.  This should allow the first process to completely save before the subprocess fires.  This keeps the subprocess from having to cascade updates to the parent process.

Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/node/ProcessState.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/node/ProcessState.java	2010-09-30 13:42:54 UTC (rev 6707)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/node/ProcessState.java	2010-09-30 13:44:18 UTC (rev 6708)
@@ -29,7 +29,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.dom4j.Element;
 import org.dom4j.tree.DefaultElement;
-
+import org.jbpm.JbpmContext;
 import org.jbpm.JbpmConfiguration.Configs;
 import org.jbpm.context.def.VariableAccess;
 import org.jbpm.context.exe.ContextInstance;
@@ -41,9 +41,12 @@
 import org.jbpm.graph.exe.ProcessInstance;
 import org.jbpm.graph.exe.Token;
 import org.jbpm.graph.log.ProcessStateLog;
+import org.jbpm.job.SignalTokenJob;
 import org.jbpm.jpdl.JpdlException;
 import org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator;
 import org.jbpm.jpdl.xml.JpdlXmlReader;
+import org.jbpm.msg.MessageService;
+import org.jbpm.svc.Services;
 import org.jbpm.util.Clock;
 
 public class ProcessState extends Node {
@@ -188,7 +191,22 @@
     }
 
     // send the signal to start the subprocess
-    subProcessInstance.signal();
+    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
+    Services services = jbpmContext.getServices();
+	if(services.getMessageService()!=null)
+	{
+		if(log.isDebugEnabled())
+		{
+			log.debug("Scheduling signal token for subprocess: "+superProcessToken);
+		}
+		MessageService messageService = services.getMessageService();
+		SignalTokenJob job = new SignalTokenJob(subProcessInstance.getRootToken());
+		messageService.send(job);
+	}
+	else
+	{
+		subProcessInstance.signal();
+	}
   }
 
   public void leave(ExecutionContext executionContext, Transition transition) {



More information about the jbpm-commits mailing list