Interface ActivityExecution
-
- All Superinterfaces:
BaseDelegateExecution,BpmnModelExecutionContext,DelegateExecution,ProcessEngineServicesAware,VariableScope
- All Known Implementing Classes:
ExecutionEntity,ExecutionImpl,PvmExecutionImpl
public interface ActivityExecution extends DelegateExecution
- Author:
- Tom Baeyens, Joram Barrez, Daniel Meyer, Falko Menge
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<ScopeImpl,PvmExecutionImpl>createActivityExecutionMapping()Returns a mapping from scope activities to scope executions for all scopes that are ancestors of the activity currently executed by this execution.ActivityExecutioncreateExecution()creates a new execution.CmmnCaseInstancecreateSubCaseInstance(CmmnCaseDefinition caseDefinition)Creates a new sub case instance.CmmnCaseInstancecreateSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey)Creates a new sub case instance.PvmProcessInstancecreateSubProcessInstance(PvmProcessDefinition processDefinition)creates a new sub process instance.PvmProcessInstancecreateSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey)PvmProcessInstancecreateSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)voiddestroy()voidend(boolean isScopeComplete)ends this execution.voidendCompensation()Execution finished compensation.voidenterActivityInstance()invoked to notify the execution that a new activity instance is startedvoidexecuteActivity(PvmActivity activity)Executes theActivityBehaviorassociated with the given activity.ActivityExecutionfindExecutionForFlowScope(PvmScope targetScope)Assumption: the current execution is active and executing an activity (getActivity()is not null).List<ActivityExecution>findInactiveChildExecutions(PvmActivity activity)List<ActivityExecution>findInactiveConcurrentExecutions(PvmActivity activity)Retrieves all executions which are concurrent and inactive at the given activity.voidforceUpdate()PvmActivitygetActivity()returns the currentPvmActivityof the execution.StringgetActivityInstanceId()return the Id of the activity instance currently executed by this executionList<? extends ActivityExecution>getExecutions()returns the list of execution of which this execution the parent of.PvmActivitygetNextActivity()An activity which is to be started next.List<? extends ActivityExecution>getNonEventScopeExecutions()returns child executions that are not event scope executions.ActivityExecutiongetParent()returns the parent of this execution, or null if there no parent.StringgetParentActivityInstanceId()return the Id of the parent activity instance currently executed by this executionTransitionImplgetTransition()booleanhasChildren()voidinactivate()Inactivates this execution.voidinterrupt(String reason)Called when an execution is interrupted.booleanisActive()returns whether this execution is currently active.booleanisCompleteScope()Returns whether this execution completed the parent scope.booleanisConcurrent()returns whether this execution is concurrent or not.booleanisEnded()returns whether this execution has ended or not.booleanisProcessInstanceExecution()returns whether this execution is a process instance or not.booleanisScope()Returns whether this execution is a scope.voidleaveActivityInstance()invoked to notify the execution that an activity instance is ended.voidleaveActivityViaTransition(PvmTransition outgoingTransition)voidleaveActivityViaTransitions(List<PvmTransition> outgoingTransitions, List<? extends ActivityExecution> joinedExecutions)Takes the given outgoing transitions, and potentially reusing the given list of executions that were previously joined.voidremove()voidsetActive(boolean isActive)makes this execution active or inactive.voidsetActivity(PvmActivity activity)voidsetActivityInstanceId(String id)voidsetConcurrent(boolean isConcurrent)changes the concurrent indicator on this execution.voidsetEnded(boolean b)voidsetIgnoreAsync(boolean ignoreAsync)voidsetScope(boolean isScope)Changes whether this execution is a scope or notvoidsignal(String string, Object signalData)booleantryPruneLastConcurrentChild()-
Methods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getBusinessKey, getEventName, getId
-
Methods inherited from interface org.camunda.bpm.engine.delegate.BpmnModelExecutionContext
getBpmnModelElementInstance, getBpmnModelInstance
-
Methods inherited from interface org.camunda.bpm.engine.delegate.DelegateExecution
createIncident, createIncident, getCurrentActivityId, getCurrentActivityName, getCurrentTransitionId, getParentId, getProcessBusinessKey, getProcessDefinitionId, getProcessInstance, getProcessInstanceId, getSuperExecution, getTenantId, isCanceled, resolveIncident, setProcessBusinessKey, setVariable
-
Methods inherited from interface org.camunda.bpm.engine.delegate.ProcessEngineServicesAware
getProcessEngine, getProcessEngineServices
-
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariableScopeKey, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
-
-
-
-
Method Detail
-
getActivity
PvmActivity getActivity()
returns the currentPvmActivityof the execution.
-
enterActivityInstance
void enterActivityInstance()
invoked to notify the execution that a new activity instance is started
-
leaveActivityInstance
void leaveActivityInstance()
invoked to notify the execution that an activity instance is ended.
-
setActivityInstanceId
void setActivityInstanceId(String id)
-
getActivityInstanceId
String getActivityInstanceId()
return the Id of the activity instance currently executed by this execution- Specified by:
getActivityInstanceIdin interfaceDelegateExecution
-
getParentActivityInstanceId
String getParentActivityInstanceId()
return the Id of the parent activity instance currently executed by this execution- Specified by:
getParentActivityInstanceIdin interfaceDelegateExecution
-
createExecution
ActivityExecution createExecution()
creates a new execution. This execution will be the parent of the newly created execution. properties processDefinition, processInstance and activity will be initialized.
-
createSubProcessInstance
PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition)
creates a new sub process instance. The current execution will be the super execution of the created execution.- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.
-
createSubProcessInstance
PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey)
- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.businessKey- the business key of the process instance- See Also:
createSubProcessInstance(PvmProcessDefinition)
-
createSubProcessInstance
PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)
- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.businessKey- the business key of the process instancecaseInstanceId- the case instance id of the process instance- See Also:
createSubProcessInstance(PvmProcessDefinition)
-
createSubCaseInstance
CmmnCaseInstance createSubCaseInstance(CmmnCaseDefinition caseDefinition)
Creates a new sub case instance.
Thisexecution will be the super execution of the created sub case instance.- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.
-
createSubCaseInstance
CmmnCaseInstance createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey)
Creates a new sub case instance.
Thisexecution will be the super execution of the created sub case instance.- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.businessKey- The businessKey to be set on sub case instance.
-
getParent
ActivityExecution getParent()
returns the parent of this execution, or null if there no parent.
-
getExecutions
List<? extends ActivityExecution> getExecutions()
returns the list of execution of which this execution the parent of. This is a copy of the actual list, so a modification has no direct effect.
-
getNonEventScopeExecutions
List<? extends ActivityExecution> getNonEventScopeExecutions()
returns child executions that are not event scope executions.
-
hasChildren
boolean hasChildren()
- Returns:
- true if this execution has child executions (event scope executions or not)
-
end
void end(boolean isScopeComplete)
ends this execution.
-
endCompensation
void endCompensation()
Execution finished compensation. Removes this execution and notifies listeners.
-
setActive
void setActive(boolean isActive)
makes this execution active or inactive.
-
isActive
boolean isActive()
returns whether this execution is currently active.
-
isEnded
boolean isEnded()
returns whether this execution has ended or not.
-
setConcurrent
void setConcurrent(boolean isConcurrent)
changes the concurrent indicator on this execution.
-
isConcurrent
boolean isConcurrent()
returns whether this execution is concurrent or not.
-
isProcessInstanceExecution
boolean isProcessInstanceExecution()
returns whether this execution is a process instance or not.
-
inactivate
void inactivate()
Inactivates this execution. This is useful for example in a join: the execution still exists, but it is not longer active.
-
isScope
boolean isScope()
Returns whether this execution is a scope.
-
setScope
void setScope(boolean isScope)
Changes whether this execution is a scope or not
-
isCompleteScope
boolean isCompleteScope()
Returns whether this execution completed the parent scope.
-
findInactiveConcurrentExecutions
List<ActivityExecution> findInactiveConcurrentExecutions(PvmActivity activity)
Retrieves all executions which are concurrent and inactive at the given activity.
-
findInactiveChildExecutions
List<ActivityExecution> findInactiveChildExecutions(PvmActivity activity)
-
leaveActivityViaTransitions
void leaveActivityViaTransitions(List<PvmTransition> outgoingTransitions, List<? extends ActivityExecution> joinedExecutions)
Takes the given outgoing transitions, and potentially reusing the given list of executions that were previously joined.
-
leaveActivityViaTransition
void leaveActivityViaTransition(PvmTransition outgoingTransition)
-
executeActivity
void executeActivity(PvmActivity activity)
Executes theActivityBehaviorassociated with the given activity.
-
interrupt
void interrupt(String reason)
Called when an execution is interrupted. This will remove all associated entities such as event subscriptions, jobs, ...
-
getNextActivity
PvmActivity getNextActivity()
An activity which is to be started next.
-
remove
void remove()
-
destroy
void destroy()
-
setActivity
void setActivity(PvmActivity activity)
-
tryPruneLastConcurrentChild
boolean tryPruneLastConcurrentChild()
-
forceUpdate
void forceUpdate()
-
getTransition
TransitionImpl getTransition()
-
findExecutionForFlowScope
ActivityExecution findExecutionForFlowScope(PvmScope targetScope)
Assumption: the current execution is active and executing an activity (getActivity()is not null). For a given target scope, this method returns the scope execution.- Parameters:
targetScope- scope activity or process definition for which the scope execution should be found; must be an ancestor of the execution's current activity- Returns:
-
createActivityExecutionMapping
Map<ScopeImpl,PvmExecutionImpl> createActivityExecutionMapping()
Returns a mapping from scope activities to scope executions for all scopes that are ancestors of the activity currently executed by this execution. Assumption: the current execution is active and executing an activity (getActivity()is not null).
-
setEnded
void setEnded(boolean b)
-
setIgnoreAsync
void setIgnoreAsync(boolean ignoreAsync)
-
-