Class ProcessInstanceModificationBuilderImpl
- java.lang.Object
- 
- org.camunda.bpm.engine.impl.ProcessInstanceModificationBuilderImpl
 
- 
- All Implemented Interfaces:
- ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>,- InstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>,- ProcessInstanceModificationBuilder,- ProcessInstanceModificationInstantiationBuilder
 
 public class ProcessInstanceModificationBuilderImpl extends java.lang.Object implements ProcessInstanceModificationInstantiationBuilder - Author:
- Thorben Lindhauer
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.Stringannotationprotected CommandContextcommandContextprotected CommandExecutorcommandExecutorprotected booleanexternallyTerminatedprotected java.lang.StringmodificationReasonprotected java.util.List<AbstractProcessInstanceModificationCommand>operationsprotected java.lang.StringprocessInstanceIdprotected VariableMapprocessVariablesprotected booleanskipCustomListenersprotected booleanskipIoMappings
 - 
Constructor SummaryConstructors Constructor Description ProcessInstanceModificationBuilderImpl()ProcessInstanceModificationBuilderImpl(java.lang.String processInstanceId)ProcessInstanceModificationBuilderImpl(CommandContext commandContext, java.lang.String processInstanceId)ProcessInstanceModificationBuilderImpl(CommandContext commandContext, java.lang.String processInstanceId, java.lang.String modificationReason)ProcessInstanceModificationBuilderImpl(CommandExecutor commandExecutor, java.lang.String processInstanceId)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessInstanceModificationBuildercancelActivityInstance(java.lang.String activityInstanceId)Submits the instruction:ProcessInstanceModificationBuildercancelAllForActivity(java.lang.String activityId)Submits the instruction:ProcessInstanceModificationBuildercancellationSourceExternal(boolean external)A canceled process instance receives a termination state to indicate the source of the cancellation call.ProcessInstanceModificationBuildercancelTransitionInstance(java.lang.String transitionInstanceId)Submits the instruction:voidexecute()Execute all instructions.voidexecute(boolean skipCustomListeners, boolean skipIoMappings)voidexecute(boolean writeUserOperationLog, boolean skipCustomListeners, boolean skipIoMappings)BatchexecuteAsync()Execute all instructions asynchronously.BatchexecuteAsync(boolean skipCustomListeners, boolean skipIoMappings)java.lang.StringgetAnnotation()CommandContextgetCommandContext()CommandExecutorgetCommandExecutor()protected AbstractInstantiationCmdgetCurrentInstantiation()java.util.List<AbstractProcessInstanceModificationCommand>getModificationOperations()java.lang.StringgetModificationReason()java.lang.StringgetProcessInstanceId()VariableMapgetProcessVariables()booleanisExternallyTerminated()booleanisSkipCustomListeners()booleanisSkipIoMappings()ProcessInstanceModificationBuildersetAnnotation(java.lang.String annotation)Provides annotation for the current modification.voidsetAnnotationInternal(java.lang.String annotation)voidsetModificationOperations(java.util.List<AbstractProcessInstanceModificationCommand> operations)voidsetModificationReason(java.lang.String modificationReason)voidsetSkipCustomListeners(boolean skipCustomListeners)voidsetSkipIoMappings(boolean skipIoMappings)ProcessInstanceModificationInstantiationBuildersetVariable(java.lang.String name, java.lang.Object value)If an instruction is submitted before then the variable is set when the instruction is executed.ProcessInstanceModificationInstantiationBuildersetVariableLocal(java.lang.String name, java.lang.Object value)If an instruction is submitted before then the local variable is set when the instruction is executed.ProcessInstanceModificationInstantiationBuildersetVariables(java.util.Map<java.lang.String,java.lang.Object> variables)If an instruction is submitted before then all variables are set when the instruction is executed.ProcessInstanceModificationInstantiationBuildersetVariablesLocal(java.util.Map<java.lang.String,java.lang.Object> variables)If an instruction is submitted before then all local variables are set when the instruction is executed.ProcessInstanceModificationInstantiationBuilderstartAfterActivity(java.lang.String activityId)Submits an instruction that behaves likeInstantiationBuilder.startTransition(String)and always instantiates the single outgoing sequence flow of the given activity.ProcessInstanceModificationInstantiationBuilderstartAfterActivity(java.lang.String activityId, java.lang.String ancestorActivityInstanceId)Submits an instruction that behaves likeProcessInstanceModificationBuilder.startTransition(String,String)and always instantiates the single outgoing sequence flow of the given activity.ProcessInstanceModificationInstantiationBuilderstartBeforeActivity(java.lang.String activityId)Submits the instruction:ProcessInstanceModificationInstantiationBuilderstartBeforeActivity(java.lang.String activityId, java.lang.String ancestorActivityInstanceId)Submits the instruction:ProcessInstanceModificationInstantiationBuilderstartTransition(java.lang.String transitionId)Submits the instruction:ProcessInstanceModificationInstantiationBuilderstartTransition(java.lang.String transitionId, java.lang.String ancestorActivityInstanceId)Submits the instruction:
 
- 
- 
- 
Field Detail- 
commandExecutorprotected CommandExecutor commandExecutor 
 - 
commandContextprotected CommandContext commandContext 
 - 
processInstanceIdprotected java.lang.String processInstanceId 
 - 
modificationReasonprotected java.lang.String modificationReason 
 - 
skipCustomListenersprotected boolean skipCustomListeners 
 - 
skipIoMappingsprotected boolean skipIoMappings 
 - 
externallyTerminatedprotected boolean externallyTerminated 
 - 
annotationprotected java.lang.String annotation 
 - 
operationsprotected java.util.List<AbstractProcessInstanceModificationCommand> operations 
 - 
processVariablesprotected VariableMap processVariables 
 
- 
 - 
Constructor Detail- 
ProcessInstanceModificationBuilderImplpublic ProcessInstanceModificationBuilderImpl(CommandExecutor commandExecutor, java.lang.String processInstanceId) 
 - 
ProcessInstanceModificationBuilderImplpublic ProcessInstanceModificationBuilderImpl(CommandContext commandContext, java.lang.String processInstanceId) 
 - 
ProcessInstanceModificationBuilderImplpublic ProcessInstanceModificationBuilderImpl(CommandContext commandContext, java.lang.String processInstanceId, java.lang.String modificationReason) 
 - 
ProcessInstanceModificationBuilderImplpublic ProcessInstanceModificationBuilderImpl(java.lang.String processInstanceId) 
 - 
ProcessInstanceModificationBuilderImplpublic ProcessInstanceModificationBuilderImpl() 
 
- 
 - 
Method Detail- 
cancelActivityInstancepublic ProcessInstanceModificationBuilder cancelActivityInstance(java.lang.String activityInstanceId) Description copied from interface:ProcessInstanceModificationBuilderSubmits the instruction: Cancel an activity instance in a process. If this instance has child activity instances (e.g. in a subprocess instance), these children, their grandchildren, etc. are cancelled as well. Process instance cancellation will propagate upward, removing any parent process instances that are only waiting on the cancelled process to complete. - Specified by:
- cancelActivityInstancein interface- ProcessInstanceModificationBuilder
- Parameters:
- activityInstanceId- the id of the activity instance to cancel
 
 - 
cancelTransitionInstancepublic ProcessInstanceModificationBuilder cancelTransitionInstance(java.lang.String transitionInstanceId) Description copied from interface:ProcessInstanceModificationBuilderSubmits the instruction: Cancel a transition instance (i.e. an async continuation) in a process. - Specified by:
- cancelTransitionInstancein interface- ProcessInstanceModificationBuilder
- Parameters:
- transitionInstanceId- the id of the transition instance to cancel
 
 - 
cancelAllForActivitypublic ProcessInstanceModificationBuilder cancelAllForActivity(java.lang.String activityId) Description copied from interface:ProcessInstanceModificationBuilderSubmits the instruction: Cancel all instances of the given activity in an arbitrary order, which are: - activity instances of that activity
- transition instances entering or leaving that activity
 Therefore behaves like ProcessInstanceModificationBuilder.cancelActivityInstance(String)for each individual activity instance and likeProcessInstanceModificationBuilder.cancelTransitionInstance(String)for each individual transition instance.The cancellation order of the instances is arbitrary - Specified by:
- cancelAllForActivityin interface- ProcessInstanceModificationBuilder
- Parameters:
- activityId- the activity for which all instances should be cancelled
 
 - 
cancellationSourceExternalpublic ProcessInstanceModificationBuilder cancellationSourceExternal(boolean external) Description copied from interface:ProcessInstanceModificationBuilderA canceled process instance receives a termination state to indicate the source of the cancellation call. The state can have the following values: - EXTERNALLY_TERMINATED: the cancellation was triggered by an external source. (e.g. REST call, external application)
- INTERNALLY_TERMINATED: the cancellation was triggered internally. (e.g. by the engine)
 - Specified by:
- cancellationSourceExternalin interface- ProcessInstanceModificationBuilder
- Parameters:
- external- was the cancellation triggered by an external source?- truefor- EXTERNALLY_TERMINATED,- falsefor- INTERNALLY_TERMINATED.
 
 - 
startBeforeActivitypublic ProcessInstanceModificationInstantiationBuilder startBeforeActivity(java.lang.String activityId) Description copied from interface:InstantiationBuilderSubmits the instruction: Start before the specified activity. In particular: - In the parent activity hierarchy, determine the closest existing ancestor activity instance
- Instantiate all parent activities up to the ancestor's activity
- Instantiate and execute the given activity (respects the asyncBefore attribute of the activity)
 - Specified by:
- startBeforeActivityin interface- InstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>
- Parameters:
- activityId- the activity to instantiate
 
 - 
startBeforeActivitypublic ProcessInstanceModificationInstantiationBuilder startBeforeActivity(java.lang.String activityId, java.lang.String ancestorActivityInstanceId) Description copied from interface:ProcessInstanceModificationBuilderSubmits the instruction: Start before the specified activity. Instantiate the given activity as a descendant of the given ancestor activity instance. In particular: - Instantiate all activities between the ancestor activity and the activity to execute
- Instantiate and execute the given activity (respects the asyncBefore attribute of the activity)
 - Specified by:
- startBeforeActivityin interface- ProcessInstanceModificationBuilder
- Parameters:
- activityId- the activity to instantiate
- ancestorActivityInstanceId- the ID of an existing activity instance under which the new activity instance should be created
 
 - 
startAfterActivitypublic ProcessInstanceModificationInstantiationBuilder startAfterActivity(java.lang.String activityId) Description copied from interface:InstantiationBuilderSubmits an instruction that behaves likeInstantiationBuilder.startTransition(String)and always instantiates the single outgoing sequence flow of the given activity. Does not consider asyncAfter.- Specified by:
- startAfterActivityin interface- InstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>
- Parameters:
- activityId- the activity for which the outgoing flow should be executed
 
 - 
startAfterActivitypublic ProcessInstanceModificationInstantiationBuilder startAfterActivity(java.lang.String activityId, java.lang.String ancestorActivityInstanceId) Description copied from interface:ProcessInstanceModificationBuilderSubmits an instruction that behaves likeProcessInstanceModificationBuilder.startTransition(String,String)and always instantiates the single outgoing sequence flow of the given activity. Does not consider asyncAfter.- Specified by:
- startAfterActivityin interface- ProcessInstanceModificationBuilder
- Parameters:
- activityId- the activity for which the outgoing flow should be executed
 
 - 
startTransitionpublic ProcessInstanceModificationInstantiationBuilder startTransition(java.lang.String transitionId) Description copied from interface:InstantiationBuilderSubmits the instruction: Start a sequence flow. In particular: - In the parent activity hierarchy, determine the closest existing ancestor activity instance
- Instantiate all parent activities up to the ancestor's activity
- Execute the given transition (does not consider sequence flow conditions)
 - Specified by:
- startTransitionin interface- InstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>
- Parameters:
- transitionId- the sequence flow to execute
 
 - 
startTransitionpublic ProcessInstanceModificationInstantiationBuilder startTransition(java.lang.String transitionId, java.lang.String ancestorActivityInstanceId) Description copied from interface:ProcessInstanceModificationBuilderSubmits the instruction: Start the specified sequence flow. Instantiate the given sequence flow as a descendant of the given ancestor activity instance. In particular: - Instantiate all activities between the ancestor activity and the activity to execute
- Execute the given transition (does not consider sequence flow conditions)
 - Specified by:
- startTransitionin interface- ProcessInstanceModificationBuilder
- Parameters:
- transitionId- the sequence flow to execute
- ancestorActivityInstanceId- the ID of an existing activity instance under which the new transition should be executed
 
 - 
getCurrentInstantiationprotected AbstractInstantiationCmd getCurrentInstantiation() 
 - 
setVariablepublic ProcessInstanceModificationInstantiationBuilder setVariable(java.lang.String name, java.lang.Object value) Description copied from interface:ActivityInstantiationBuilderIf an instruction is submitted before then the variable is set when the instruction is executed. Otherwise, the variable is set on the process instance itself.- Specified by:
- setVariablein interface- ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>
 
 - 
setVariableLocalpublic ProcessInstanceModificationInstantiationBuilder setVariableLocal(java.lang.String name, java.lang.Object value) Description copied from interface:ActivityInstantiationBuilderIf an instruction is submitted before then the local variable is set when the instruction is executed. Otherwise, the variable is set on the process instance itself.- Specified by:
- setVariableLocalin interface- ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>
 
 - 
setVariablespublic ProcessInstanceModificationInstantiationBuilder setVariables(java.util.Map<java.lang.String,java.lang.Object> variables) Description copied from interface:ActivityInstantiationBuilderIf an instruction is submitted before then all variables are set when the instruction is executed. Otherwise, the variables are set on the process instance itself.- Specified by:
- setVariablesin interface- ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>
 
 - 
setVariablesLocalpublic ProcessInstanceModificationInstantiationBuilder setVariablesLocal(java.util.Map<java.lang.String,java.lang.Object> variables) Description copied from interface:ActivityInstantiationBuilderIf an instruction is submitted before then all local variables are set when the instruction is executed. Otherwise, the variables are set on the process instance itself.- Specified by:
- setVariablesLocalin interface- ActivityInstantiationBuilder<ProcessInstanceModificationInstantiationBuilder>
 
 - 
setAnnotationpublic ProcessInstanceModificationBuilder setAnnotation(java.lang.String annotation) Description copied from interface:ProcessInstanceModificationBuilderProvides annotation for the current modification.- Specified by:
- setAnnotationin interface- ProcessInstanceModificationBuilder
 
 - 
executepublic void execute() Description copied from interface:ProcessInstanceModificationBuilderExecute all instructions. Custom execution and task listeners, as well as task input output mappings are executed.- Specified by:
- executein interface- ProcessInstanceModificationBuilder
 
 - 
executepublic void execute(boolean skipCustomListeners, boolean skipIoMappings)- Specified by:
- executein interface- ProcessInstanceModificationBuilder
- Parameters:
- skipCustomListeners- specifies whether custom listeners (task and execution) should be invoked when executing the instructions
- skipIoMappings- specifies whether input/output mappings for tasks should be invoked throughout the transaction when executing the instructions
 
 - 
executepublic void execute(boolean writeUserOperationLog, boolean skipCustomListeners, boolean skipIoMappings)
 - 
executeAsyncpublic Batch executeAsync() Description copied from interface:ProcessInstanceModificationBuilderExecute all instructions asynchronously. Custom execution and task listeners, as well as task input output mappings are executed.- Specified by:
- executeAsyncin interface- ProcessInstanceModificationBuilder
- Returns:
- a batch job to be executed by the executor
 
 - 
executeAsyncpublic Batch executeAsync(boolean skipCustomListeners, boolean skipIoMappings) - Specified by:
- executeAsyncin interface- ProcessInstanceModificationBuilder
- Parameters:
- skipCustomListeners- specifies whether custom listeners (task and execution) should be invoked when executing the instructions
- skipIoMappings- specifies whether input/output mappings for tasks should be invoked throughout the transaction when executing the instructions
- Returns:
- a batch job to be executed by the executor
 
 - 
getCommandExecutorpublic CommandExecutor getCommandExecutor() 
 - 
getCommandContextpublic CommandContext getCommandContext() 
 - 
getProcessInstanceIdpublic java.lang.String getProcessInstanceId() 
 - 
getModificationOperationspublic java.util.List<AbstractProcessInstanceModificationCommand> getModificationOperations() 
 - 
setModificationOperationspublic void setModificationOperations(java.util.List<AbstractProcessInstanceModificationCommand> operations) 
 - 
isSkipCustomListenerspublic boolean isSkipCustomListeners() 
 - 
isSkipIoMappingspublic boolean isSkipIoMappings() 
 - 
isExternallyTerminatedpublic boolean isExternallyTerminated() 
 - 
setSkipCustomListenerspublic void setSkipCustomListeners(boolean skipCustomListeners) 
 - 
setSkipIoMappingspublic void setSkipIoMappings(boolean skipIoMappings) 
 - 
getProcessVariablespublic VariableMap getProcessVariables() 
 - 
getModificationReasonpublic java.lang.String getModificationReason() 
 - 
setModificationReasonpublic void setModificationReason(java.lang.String modificationReason) 
 - 
getAnnotationpublic java.lang.String getAnnotation() 
 - 
setAnnotationInternalpublic void setAnnotationInternal(java.lang.String annotation) 
 
- 
 
-