org.jbpm.command
Class ChangeProcessInstanceVersionCommand
java.lang.Object
org.jbpm.command.AbstractBaseCommand
org.jbpm.command.AbstractProcessInstanceBaseCommand
org.jbpm.command.ChangeProcessInstanceVersionCommand
- All Implemented Interfaces:
- java.io.Serializable, Command
public class ChangeProcessInstanceVersionCommand
- extends AbstractProcessInstanceBaseCommand
THIS COMMAND IS NOT YET STABLE, BUT FEEL FREE TO TEST :-)
Status update: Still not complete, but refactored and added simple test cases:
ChangeProcessInstanceVersionCommandTest.
Change the version of a running process instance.
This works only, if the current node is also available in the new
version of the process definition or a name mapping has to be provided.
Currently known limitations:
-
Tasks cannot move "into" another node. If an active
TaskInstance exists, the Task definition must
exist in the TaskNode with the same (or mapped) name.
Otherwise the right node cannot be found easily because it may be
ambiguous.
- Sub processes aren't yet tested. Since the
ProcessState is
a Node like any other, it should work anyway.
- Can have negative impact on referential integrity! Because
one
ProcessInstance can have ProcessLogs point to
old ProcessDefinitions. Hence, delete a ProcessDefinition
may not work and throw an Exception (Integrity constraint violation)
- In combination with ESB the ESB uses
Token.id and Node.id
as correlation identifier. After changing the version of a ProcessInstance
the Node.id has changed, so a signal from ESB will result in an exception
and has to be corrected manually.
- Author:
- Bernd Ruecker (bernd.ruecker@camunda.com)
- See Also:
- Serialized Form
| Methods inherited from class org.jbpm.command.AbstractProcessInstanceBaseCommand |
execute, getJbpmContext, getProcessInstanceId, getProcessInstanceIds, getProcessName, getProcessVersion, isOnlyRunning, isOperateOnSingleObject, onlyRunning, processInstanceId, processInstanceIds, processName, processVersion, setOnlyRunning, setProcessInstanceId, setProcessInstanceIds, setProcessName, setProcessVersion, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OLD_VERSION_PROCESS_VARIABLE_NAME
public static final java.lang.String OLD_VERSION_PROCESS_VARIABLE_NAME
- See Also:
- Constant Field Values
ChangeProcessInstanceVersionCommand
public ChangeProcessInstanceVersionCommand()
ChangeProcessInstanceVersionCommand
public ChangeProcessInstanceVersionCommand(long processId,
int newVersion)
getAdditionalToStringInformation
public java.lang.String getAdditionalToStringInformation()
- Overrides:
getAdditionalToStringInformation in class AbstractBaseCommand
execute
public ProcessInstance execute(ProcessInstance pi)
- Specified by:
execute in class AbstractProcessInstanceBaseCommand
getNodeNameMapping
public java.util.Map getNodeNameMapping()
setNodeNameMapping
public void setNodeNameMapping(java.util.Map<java.lang.String,java.lang.String> nameMapping)
getNewVersion
public int getNewVersion()
setNewVersion
public void setNewVersion(int newVersion)
getTaskNameMapping
public java.util.Map getTaskNameMapping()
setTaskNameMapping
public void setTaskNameMapping(java.util.Map<java.lang.String,java.lang.String> nameMapping)
getProcessId
public long getProcessId()
- Deprecated. use getProcessInstanceId instead
setProcessId
public void setProcessId(long processId)
- Deprecated. use setProcessInstanceId instead
getNameMapping
public java.util.Map getNameMapping()
- Deprecated. use getNodeNameMapping instead
setNameMapping
public void setNameMapping(java.util.Map nameMapping)
- Deprecated. use setNodeNameMapping instead
nodeNameMapping
public ChangeProcessInstanceVersionCommand nodeNameMapping(java.util.Map<java.lang.String,java.lang.String> nameMapping)
newVersion
public ChangeProcessInstanceVersionCommand newVersion(int newVersion)
taskNameMapping
public ChangeProcessInstanceVersionCommand taskNameMapping(java.util.Map<java.lang.String,java.lang.String> nameMapping)
nodeNameMappingAdd
public ChangeProcessInstanceVersionCommand nodeNameMappingAdd(java.lang.String oldNodeName,
java.lang.String newNodeName)
taskNameMappingAdd
public ChangeProcessInstanceVersionCommand taskNameMappingAdd(java.lang.String oldTaskName,
java.lang.String newNodeName)
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.