public class ExecutionImpl extends Object implements Serializable, ActivityExecution, ExecutionListenerExecution, PvmExecution, InterpretableExecution
Modifier and Type | Field and Description |
---|---|
protected ActivityImpl |
activity
current activity
|
protected String |
deleteReason |
protected boolean |
deleteRoot |
protected String |
eventName |
protected PvmProcessElement |
eventSource |
protected int |
executionListenerIndex |
protected List<ExecutionImpl> |
executions
nested executions representing scopes or concurrent paths
|
protected boolean |
isActive
indicates if this execution represents an active path of execution.
|
protected boolean |
isConcurrent |
protected boolean |
isEnded |
protected boolean |
isEventScope |
protected boolean |
isOperating |
protected boolean |
isScope |
protected AtomicOperation |
nextOperation
next operation.
|
protected ExecutionImpl |
parent
the parent execution
|
protected ProcessDefinitionImpl |
processDefinition |
protected ExecutionImpl |
processInstance
the process instance.
|
protected ExecutionImpl |
replacedBy
when execution structure is pruned during a takeAll, then
the original execution has to be resolved to the replaced execution.
|
protected StartingExecution |
startingExecution
only available until the process instance is started
|
protected ExecutionImpl |
subProcessInstance
reference to a subprocessinstance, not-null if currently subprocess is started from this execution
|
protected ExecutionImpl |
superExecution
super execution, not-null if this execution is part of a subprocess
|
protected TransitionImpl |
transition
current transition.
|
protected Map<String,Object> |
variables |
Constructor and Description |
---|
ExecutionImpl() |
ExecutionImpl(ActivityImpl initial) |
Modifier and Type | Method and Description |
---|---|
protected void |
collectActiveActivityIds(List<String> activeActivityIds) |
protected void |
collectVariables(Map<String,Object> collectedVariables) |
ExecutionImpl |
createExecution()
creates a new execution.
|
PvmProcessInstance |
createSubProcessInstance(PvmProcessDefinition processDefinition)
creates a new sub process instance.
|
void |
createVariableLocal(String variableName,
Object value) |
void |
createVariablesLocal(Map<String,? extends Object> variables) |
void |
deleteCascade(String deleteReason) |
void |
deleteVariablesLocal() |
void |
destroy() |
void |
destroyScope(String reason)
Called when an execution is interrupted.
|
void |
disposeStartingExecution() |
void |
end()
removes an execution.
|
protected void |
ensureActivityInitialized()
must be called before the activity member field or getActivity() is called
|
protected void |
ensureExecutionsInitialized()
must be called before memberfield executions is used.
|
protected void |
ensureParentInitialized()
must be called before memberfield parent is used.
|
protected void |
ensureProcessDefinitionInitialized()
must be called before memberfield processDefinition is used.
|
protected void |
ensureProcessInstanceInitialized()
must be called before memberfield processInstance is used.
|
protected void |
ensureScopeInitialized() |
protected void |
ensureSubProcessInstanceInitialized() |
protected void |
ensureSuperExecutionInitialized() |
protected void |
ensureVariablesInitialized() |
void |
executeActivity(PvmActivity activity)
Executes the
ActivityBehavior associated with the given activity. |
List<String> |
findActiveActivityIds() |
ExecutionImpl |
findExecution(String activityId)
searches for an execution positioned in the given activity
|
List<ActivityExecution> |
findInactiveConcurrentExecutions(PvmActivity activity)
Retrieves all executions which are concurrent and inactive at the given activity.
|
ActivityImpl |
getActivity()
ensures initialization and returns the activity
|
String |
getBusinessKey()
The business key for this execution.
|
String |
getCurrentActivityId()
Gets the id of the current activity.
|
String |
getCurrentActivityName()
Gets the name of the current activity.
|
String |
getDeleteReason() |
EngineServices |
getEngineServices()
All Activiti services can be accessed through this interface.
|
String |
getEventName()
The
event name in case this execution is passed in for an ExecutionListener |
PvmProcessElement |
getEventSource() |
Integer |
getExecutionListenerIndex() |
List<ExecutionImpl> |
getExecutions()
ensures initialization and returns the non-null executions list
|
String |
getId()
Unique id of this path of execution that can be used as a handle to provide external signals back into the engine after wait states.
|
ExecutionImpl |
getParent()
ensures initialization and returns the parent
|
String |
getParentId()
Gets the id of the parent of this execution.
|
String |
getProcessBusinessKey()
The business key for the process instance this execution is associated with.
|
ProcessDefinitionImpl |
getProcessDefinition()
ensures initialization and returns the process definition.
|
String |
getProcessDefinitionId()
The process definition key for the process instance this execution is associated with.
|
ExecutionImpl |
getProcessInstance()
ensures initialization and returns the process instance.
|
String |
getProcessInstanceId()
Reference to the overall process instance
|
ExecutionImpl |
getReplacedBy() |
StartingExecution |
getStartingExecution() |
ExecutionImpl |
getSubProcessInstance() |
ExecutionImpl |
getSuperExecution() |
String |
getSuperExecutionId()
Gets the id of the calling execution.
|
String |
getTenantId()
Returns the tenant id, if any is set before on the process definition or process instance.
|
protected String |
getToStringIdentity() |
TransitionImpl |
getTransition() |
Object |
getVariable(String variableName) |
Object |
getVariable(String variableName,
boolean fetchAllVariables) |
<T> T |
getVariable(String variableName,
Class<T> variableClass) |
VariableInstance |
getVariableInstance(String variableName) |
VariableInstance |
getVariableInstance(String variableName,
boolean fetchAllVariables) |
VariableInstance |
getVariableInstanceLocal(String variableName) |
VariableInstance |
getVariableInstanceLocal(String variableName,
boolean fetchAllVariables) |
Map<String,VariableInstance> |
getVariableInstances() |
Map<String,VariableInstance> |
getVariableInstances(Collection<String> variableNames) |
Map<String,VariableInstance> |
getVariableInstances(Collection<String> variableNames,
boolean fetchAllVariables) |
Map<String,VariableInstance> |
getVariableInstancesLocal() |
Map<String,VariableInstance> |
getVariableInstancesLocal(Collection<String> variableNames) |
Map<String,VariableInstance> |
getVariableInstancesLocal(Collection<String> variableNames,
boolean fetchAllVariables) |
Object |
getVariableLocal(String variableName) |
Object |
getVariableLocal(String variableName,
boolean fetchAllVariables) |
<T> T |
getVariableLocal(String variableName,
Class<T> variableClass) |
Set<String> |
getVariableNames() |
Set<String> |
getVariableNamesLocal() |
Map<String,Object> |
getVariables() |
Map<String,Object> |
getVariables(Collection<String> variableNames) |
Map<String,Object> |
getVariables(Collection<String> variableNames,
boolean fetchAllVariables) |
Map<String,Object> |
getVariablesLocal() |
Map<String,Object> |
getVariablesLocal(Collection<String> variableNames) |
Map<String,Object> |
getVariablesLocal(Collection<String> variableNames,
boolean fetchAllVariables) |
boolean |
hasVariable(String variableName) |
boolean |
hasVariableLocal(String variableName) |
boolean |
hasVariables() |
boolean |
hasVariablesLocal() |
void |
inactivate()
Inactivates this execution.
|
void |
initialize() |
boolean |
isActive()
returns whether this execution is currently active.
|
boolean |
isActive(String activityId) |
boolean |
isConcurrent()
returns whether this execution is concurrent or not.
|
boolean |
isDeleteRoot() |
boolean |
isEnded()
returns whether this execution has ended or not.
|
boolean |
isEventScope() |
boolean |
isProcessInstanceType()
returns whether this execution is a process instance or not.
|
boolean |
isScope()
Returns whether this execution is a scope.
|
protected ExecutionImpl |
newExecution()
instantiates a new execution.
|
void |
performOperation(AtomicOperation executionOperation) |
void |
remove() |
void |
removeVariable(String variableName)
Removes the variable and creates a new
HistoricVariableUpdateEntity
. |
void |
removeVariableLocal(String variableName)
Removes the local variable and creates a new
HistoricVariableUpdateEntity . |
void |
removeVariables()
Removes the (local) variables and creates a new
HistoricVariableUpdateEntity for each of them. |
void |
removeVariables(Collection<String> variableNames)
Removes the variables and creates a new
HistoricVariableUpdateEntity for each of them. |
void |
removeVariablesLocal()
Removes the (local) variables and creates a new
HistoricVariableUpdateEntity for each of them. |
void |
removeVariablesLocal(Collection<String> variableNames)
Removes the local variables and creates a new
HistoricVariableUpdateEntity for each of them. |
void |
setActive(boolean isActive)
makes this execution active or inactive.
|
void |
setActivity(ActivityImpl activity)
sets the current activity.
|
void |
setConcurrent(boolean isConcurrent)
changes the concurrent indicator on this execution.
|
void |
setDeleteReason(String deleteReason) |
void |
setEnded(boolean ended)
Sets whether this execution is ended or not.
|
void |
setEventName(String eventName) |
void |
setEventScope(boolean isEventScope) |
void |
setEventSource(PvmProcessElement eventSource) |
void |
setExecutionListenerIndex(Integer executionListenerIndex) |
void |
setExecutions(List<ExecutionImpl> executions) |
void |
setParent(InterpretableExecution parent)
all updates need to go through this setter as subclasses can override this method
|
void |
setProcessDefinition(ProcessDefinitionImpl processDefinition) |
void |
setProcessInstance(InterpretableExecution processInstance)
for setting the process instance, this setter must be used as subclasses can override
|
void |
setReplacedBy(InterpretableExecution replacedBy) |
void |
setScope(boolean isScope)
Changes whether this execution is a scope or not
|
void |
setSubProcessInstance(InterpretableExecution subProcessInstance) |
void |
setSuperExecution(ExecutionImpl superExecution) |
void |
setTransition(TransitionImpl transition) |
void |
setVariable(String variableName,
Object value)
Sets the variable with the provided name to the provided value.
|
void |
setVariable(String variableName,
Object value,
boolean fetchAllVariables) |
Object |
setVariableLocal(String variableName,
Object value) |
Object |
setVariableLocal(String variableName,
Object value,
boolean fetchAllVariables) |
void |
setVariableLocally(String variableName,
Object value) |
void |
setVariables(Map<String,? extends Object> variables)
Sets the provided variables to the variable scope.
|
void |
setVariablesLocal(Map<String,? extends Object> variables) |
void |
signal(String signalName,
Object signalData) |
void |
start() |
void |
take(PvmTransition transition)
leaves the current activity by taking the given transition.
|
void |
take(PvmTransition transition,
boolean fireActivityCompletedEvent) |
void |
takeAll(List<PvmTransition> transitions,
List<ActivityExecution> recyclableExecutions)
Takes the given outgoing transitions, and potentially reusing
the given list of executions that were previously joined.
|
String |
toString() |
String |
updateProcessBusinessKey(String bzKey) |
protected ProcessDefinitionImpl processDefinition
protected ActivityImpl activity
protected TransitionImpl transition
protected ExecutionImpl processInstance
protected ExecutionImpl parent
protected List<ExecutionImpl> executions
protected ExecutionImpl superExecution
protected ExecutionImpl subProcessInstance
protected StartingExecution startingExecution
protected boolean isActive
protected boolean isScope
protected boolean isConcurrent
protected boolean isEnded
protected boolean isEventScope
protected String eventName
protected PvmProcessElement eventSource
protected int executionListenerIndex
protected boolean deleteRoot
protected String deleteReason
protected ExecutionImpl replacedBy
#takeAll(List, List)} {@link OutgoingExecution}
protected AtomicOperation nextOperation
AtomicOperation
,
performOperation(AtomicOperation)
protected boolean isOperating
public ExecutionImpl()
public ExecutionImpl(ActivityImpl initial)
public ExecutionImpl createExecution()
createExecution
in interface ActivityExecution
protected ExecutionImpl newExecution()
public PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition)
ActivityExecution
createSubProcessInstance
in interface ActivityExecution
processDefinition
- The PvmProcessDefinition
of the subprocess.public void initialize()
initialize
in interface InterpretableExecution
public void destroy()
destroy
in interface InterpretableExecution
public void remove()
remove
in interface InterpretableExecution
public void destroyScope(String reason)
ActivityExecution
destroyScope
in interface ActivityExecution
public ExecutionImpl getParent()
getParent
in interface ActivityExecution
public String getSuperExecutionId()
DelegateExecution
getSuperExecutionId
in interface DelegateExecution
public String getParentId()
DelegateExecution
getParentId
in interface DelegateExecution
public void setParent(InterpretableExecution parent)
setParent
in interface InterpretableExecution
protected void ensureParentInitialized()
public List<ExecutionImpl> getExecutions()
getExecutions
in interface ActivityExecution
public ExecutionImpl getSuperExecution()
getSuperExecution
in interface InterpretableExecution
public void setSuperExecution(ExecutionImpl superExecution)
protected void ensureSuperExecutionInitialized()
public ExecutionImpl getSubProcessInstance()
getSubProcessInstance
in interface InterpretableExecution
public void setSubProcessInstance(InterpretableExecution subProcessInstance)
setSubProcessInstance
in interface InterpretableExecution
protected void ensureSubProcessInstanceInitialized()
public void deleteCascade(String deleteReason)
deleteCascade
in interface PvmProcessInstance
deleteCascade
in interface InterpretableExecution
public void end()
end
in interface ActivityExecution
public ExecutionImpl findExecution(String activityId)
findExecution
in interface PvmProcessInstance
public List<String> findActiveActivityIds()
findActiveActivityIds
in interface PvmProcessInstance
protected void ensureExecutionsInitialized()
public ProcessDefinitionImpl getProcessDefinition()
getProcessDefinition
in interface InterpretableExecution
public String getProcessDefinitionId()
DelegateExecution
getProcessDefinitionId
in interface DelegateExecution
protected void ensureProcessDefinitionInitialized()
public ExecutionImpl getProcessInstance()
getProcessInstance
in interface ActivityExecution
public String getProcessInstanceId()
DelegateExecution
getProcessInstanceId
in interface DelegateExecution
public String getBusinessKey()
DelegateExecution
getBusinessKey
in interface DelegateExecution
public String getProcessBusinessKey()
DelegateExecution
getProcessBusinessKey
in interface DelegateExecution
public void setProcessInstance(InterpretableExecution processInstance)
setProcessInstance
in interface InterpretableExecution
protected void ensureProcessInstanceInitialized()
public ActivityImpl getActivity()
getActivity
in interface ActivityExecution
getActivity
in interface PvmExecution
public void setActivity(ActivityImpl activity)
setActivity
in interface InterpretableExecution
protected void ensureActivityInitialized()
protected void ensureScopeInitialized()
public boolean isScope()
ActivityExecution
isScope
in interface ActivityExecution
isScope
in interface InterpretableExecution
public void setScope(boolean isScope)
ActivityExecution
setScope
in interface ActivityExecution
public void start()
start
in interface PvmProcessInstance
public void signal(String signalName, Object signalData)
signal
in interface PvmExecution
public void take(PvmTransition transition, boolean fireActivityCompletedEvent)
take
in interface InterpretableExecution
public void take(PvmTransition transition)
ActivityExecution
take
in interface ActivityExecution
take
in interface InterpretableExecution
public void executeActivity(PvmActivity activity)
ActivityExecution
ActivityBehavior
associated with the given activity.executeActivity
in interface ActivityExecution
public List<ActivityExecution> findInactiveConcurrentExecutions(PvmActivity activity)
ActivityExecution
findInactiveConcurrentExecutions
in interface ActivityExecution
public void takeAll(List<PvmTransition> transitions, List<ActivityExecution> recyclableExecutions)
ActivityExecution
takeAll
in interface ActivityExecution
public void performOperation(AtomicOperation executionOperation)
performOperation
in interface InterpretableExecution
public boolean isActive(String activityId)
public Object getVariable(String variableName)
getVariable
in interface VariableScope
getVariable
in interface PvmExecution
public Object getVariable(String variableName, boolean fetchAllVariables)
getVariable
in interface VariableScope
public Map<String,Object> getVariables()
getVariables
in interface VariableScope
getVariables
in interface PvmExecution
public Map<String,Object> getVariables(Collection<String> variableNames)
getVariables
in interface VariableScope
public Map<String,Object> getVariables(Collection<String> variableNames, boolean fetchAllVariables)
getVariables
in interface VariableScope
public void setVariables(Map<String,? extends Object> variables)
VariableScope
Variables are set according algorithm for
VariableScope.setVariable(String, Object)
, applied separately to each variable.
setVariables
in interface VariableScope
variables
- a map of keys and values for the variables to be set{@link VariableScope#setVariable(String, Object)}
public void setVariable(String variableName, Object value)
VariableScope
A variable is set according to the following algorithm:
In practice for most cases, this algorithm will set variables to the scope of the execution at the process instance’s root level, if there is no execution-local variable by the provided name.
setVariable
in interface VariableScope
setVariable
in interface PvmExecution
variableName
- the name of the variable to be setvalue
- the value of the variable to be setpublic void setVariable(String variableName, Object value, boolean fetchAllVariables)
setVariable
in interface VariableScope
public Object setVariableLocal(String variableName, Object value, boolean fetchAllVariables)
setVariableLocal
in interface VariableScope
public boolean hasVariable(String variableName)
hasVariable
in interface VariableScope
hasVariable
in interface PvmExecution
protected void ensureVariablesInitialized()
public EngineServices getEngineServices()
DelegateExecution
getEngineServices
in interface DelegateExecution
protected String getToStringIdentity()
public boolean isProcessInstanceType()
ActivityExecution
isProcessInstanceType
in interface ActivityExecution
public void inactivate()
ActivityExecution
inactivate
in interface ActivityExecution
public String getId()
DelegateExecution
getId
in interface DelegateExecution
public TransitionImpl getTransition()
getTransition
in interface InterpretableExecution
public void setTransition(TransitionImpl transition)
setTransition
in interface InterpretableExecution
public Integer getExecutionListenerIndex()
getExecutionListenerIndex
in interface InterpretableExecution
public void setExecutionListenerIndex(Integer executionListenerIndex)
setExecutionListenerIndex
in interface InterpretableExecution
public boolean isConcurrent()
ActivityExecution
isConcurrent
in interface ActivityExecution
public void setConcurrent(boolean isConcurrent)
ActivityExecution
setConcurrent
in interface ActivityExecution
public boolean isActive()
ActivityExecution
isActive
in interface ActivityExecution
public void setActive(boolean isActive)
ActivityExecution
setActive
in interface ActivityExecution
public boolean isEnded()
ActivityExecution
isEnded
in interface ActivityExecution
isEnded
in interface PvmProcessInstance
public void setEnded(boolean ended)
ActivityExecution
ActivityExecution.end()
to set the boolean and execution removal methods.setEnded
in interface ActivityExecution
public void setProcessDefinition(ProcessDefinitionImpl processDefinition)
setProcessDefinition
in interface InterpretableExecution
public String getEventName()
DelegateExecution
event name
in case this execution is passed in for an ExecutionListener
getEventName
in interface DelegateExecution
getEventName
in interface ExecutionListenerExecution
public void setEventName(String eventName)
setEventName
in interface InterpretableExecution
public PvmProcessElement getEventSource()
getEventSource
in interface ExecutionListenerExecution
public void setEventSource(PvmProcessElement eventSource)
setEventSource
in interface InterpretableExecution
public String getDeleteReason()
getDeleteReason
in interface ExecutionListenerExecution
public void setDeleteReason(String deleteReason)
public ExecutionImpl getReplacedBy()
getReplacedBy
in interface InterpretableExecution
public void setReplacedBy(InterpretableExecution replacedBy)
setReplacedBy
in interface InterpretableExecution
public void setExecutions(List<ExecutionImpl> executions)
public boolean isDeleteRoot()
isDeleteRoot
in interface InterpretableExecution
public String getCurrentActivityId()
DelegateExecution
getCurrentActivityId
in interface DelegateExecution
public String getCurrentActivityName()
DelegateExecution
getCurrentActivityName
in interface DelegateExecution
public Map<String,VariableInstance> getVariableInstances()
getVariableInstances
in interface VariableScope
public Map<String,VariableInstance> getVariableInstances(Collection<String> variableNames)
getVariableInstances
in interface VariableScope
public Map<String,VariableInstance> getVariableInstances(Collection<String> variableNames, boolean fetchAllVariables)
getVariableInstances
in interface VariableScope
public Map<String,VariableInstance> getVariableInstancesLocal()
getVariableInstancesLocal
in interface VariableScope
public Map<String,VariableInstance> getVariableInstancesLocal(Collection<String> variableNames)
getVariableInstancesLocal
in interface VariableScope
public Map<String,VariableInstance> getVariableInstancesLocal(Collection<String> variableNames, boolean fetchAllVariables)
getVariableInstancesLocal
in interface VariableScope
public VariableInstance getVariableInstance(String variableName)
getVariableInstance
in interface VariableScope
public VariableInstance getVariableInstance(String variableName, boolean fetchAllVariables)
getVariableInstance
in interface VariableScope
public void createVariableLocal(String variableName, Object value)
createVariableLocal
in interface VariableScope
public Object getVariableLocal(String variableName)
getVariableLocal
in interface VariableScope
public VariableInstance getVariableInstanceLocal(String variableName)
getVariableInstanceLocal
in interface VariableScope
public Object getVariableLocal(String variableName, boolean fetchAllVariables)
getVariableLocal
in interface VariableScope
public VariableInstance getVariableInstanceLocal(String variableName, boolean fetchAllVariables)
getVariableInstanceLocal
in interface VariableScope
public <T> T getVariable(String variableName, Class<T> variableClass)
getVariable
in interface VariableScope
public <T> T getVariableLocal(String variableName, Class<T> variableClass)
getVariableLocal
in interface VariableScope
public Set<String> getVariableNames()
getVariableNames
in interface VariableScope
public Set<String> getVariableNamesLocal()
getVariableNamesLocal
in interface VariableScope
public Map<String,Object> getVariablesLocal()
getVariablesLocal
in interface VariableScope
public Map<String,Object> getVariablesLocal(Collection<String> variableNames)
getVariablesLocal
in interface VariableScope
public Map<String,Object> getVariablesLocal(Collection<String> variableNames, boolean fetchAllVariables)
getVariablesLocal
in interface VariableScope
public boolean hasVariableLocal(String variableName)
hasVariableLocal
in interface VariableScope
public boolean hasVariables()
hasVariables
in interface VariableScope
public boolean hasVariablesLocal()
hasVariablesLocal
in interface VariableScope
public void removeVariable(String variableName)
VariableScope
HistoricVariableUpdateEntity
.removeVariable
in interface VariableScope
public void removeVariableLocal(String variableName)
VariableScope
HistoricVariableUpdateEntity
.removeVariableLocal
in interface VariableScope
public void removeVariables(Collection<String> variableNames)
VariableScope
HistoricVariableUpdateEntity
for each of them.removeVariables
in interface VariableScope
public void removeVariablesLocal(Collection<String> variableNames)
VariableScope
HistoricVariableUpdateEntity
for each of them.removeVariablesLocal
in interface VariableScope
public void removeVariables()
VariableScope
HistoricVariableUpdateEntity
for each of them.removeVariables
in interface VariableScope
public void removeVariablesLocal()
VariableScope
HistoricVariableUpdateEntity
for each of them.removeVariablesLocal
in interface VariableScope
public void deleteVariablesLocal()
public Object setVariableLocal(String variableName, Object value)
setVariableLocal
in interface VariableScope
public void setVariablesLocal(Map<String,? extends Object> variables)
setVariablesLocal
in interface VariableScope
public boolean isEventScope()
isEventScope
in interface InterpretableExecution
public void setEventScope(boolean isEventScope)
setEventScope
in interface InterpretableExecution
public StartingExecution getStartingExecution()
getStartingExecution
in interface InterpretableExecution
public void disposeStartingExecution()
disposeStartingExecution
in interface InterpretableExecution
public String getTenantId()
DelegateExecution
getTenantId
in interface DelegateExecution
Copyright © 2016 Alfresco. All rights reserved.