[jbpm-commits] JBoss JBPM SVN: r3673 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/command.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jan 19 08:14:53 EST 2009


Author: camunda
Date: 2009-01-19 08:14:53 -0500 (Mon, 19 Jan 2009)
New Revision: 3673

Modified:
   jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java
Log:
added marker process variable to indicate version change (and remember old version)

Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java	2009-01-19 11:05:47 UTC (rev 3672)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java	2009-01-19 13:14:53 UTC (rev 3673)
@@ -58,6 +58,8 @@
 {
 
   private static final long serialVersionUID = 2277080393930008224L;
+  
+  public static final String OLD_VERSION_PROCESS_VARIABLE_NAME = "processDefinitionVersionBeforeChange";
 
   /**
    * new version of process, if <=0, the latest process definition is used
@@ -109,6 +111,9 @@
     if (newDef==null) {
       throw new JbpmException("Process definition " + oldDef.getName() + " in version " + newVersion + " not found.");
     }
+    
+    // set process variable to remember old version
+    pi.getContextInstance().setVariable(OLD_VERSION_PROCESS_VARIABLE_NAME, oldDef.getVersion());
 
     log.debug("Start changing process id " + pi.getId() + " from version " + pi.getProcessDefinition().getVersion() + " to new version " + newDef.getVersion());
     pi.setProcessDefinition(newDef);




More information about the jbpm-commits mailing list