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

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 1 15:00:33 EDT 2010


Author: bradsdavis
Date: 2010-10-01 15:00:32 -0400 (Fri, 01 Oct 2010)
New Revision: 6723

Modified:
   jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/exe/ProcessInstance.java
Log:
Moved JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext() higher; otherwise, you potentially have to fetch it twice, which is just more work.

Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/exe/ProcessInstance.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/exe/ProcessInstance.java	2010-10-01 16:41:04 UTC (rev 6722)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/graph/exe/ProcessInstance.java	2010-10-01 19:00:32 UTC (rev 6723)
@@ -340,10 +340,13 @@
     // add the process instance end log
     rootToken.addLog(new ProcessInstanceEndLog());
 
+    
+    //Fetch this higher, rather than doing the work twice.
+    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
+    
     // is this a sub-process?
     if (superProcessToken != null && !superProcessToken.hasEnded()) {
       // is message service available?
-      JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
       MessageService messageService;
       if (jbpmContext != null
         && (messageService = jbpmContext.getServices().getMessageService()) != null) {
@@ -365,7 +368,7 @@
     }
 
     // cancel jobs associated to this process instance
-    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
+    
     // is there an active context?
     if (jbpmContext != null) {
       Services services = jbpmContext.getServices();



More information about the jbpm-commits mailing list