Package org.camunda.bpm.engine.impl
Class ModificationBuilderImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.ModificationBuilderImpl
-
- All Implemented Interfaces:
InstantiationBuilder<ModificationBuilder>
,ModificationBuilder
public class ModificationBuilderImpl extends java.lang.Object implements ModificationBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
annotation
protected CommandExecutor
commandExecutor
protected java.util.List<AbstractProcessInstanceModificationCommand>
instructions
protected java.lang.String
processDefinitionId
protected java.util.List<java.lang.String>
processInstanceIds
protected ProcessInstanceQuery
processInstanceQuery
protected boolean
skipCustomListeners
protected boolean
skipIoMappings
-
Constructor Summary
Constructors Constructor Description ModificationBuilderImpl(CommandExecutor commandExecutor, java.lang.String processDefinitionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModificationBuilder
cancelAllForActivity(java.lang.String activityId)
Submits the instruction:ModificationBuilder
cancelAllForActivity(java.lang.String activityId, boolean cancelCurrentActiveActivityInstances)
Submits the instruction:void
execute()
Execute the modification synchronously.void
execute(boolean writeUserOperationLog)
Batch
executeAsync()
Execute the modification asynchronously as batch.java.lang.String
getAnnotation()
CommandExecutor
getCommandExecutor()
java.util.List<AbstractProcessInstanceModificationCommand>
getInstructions()
java.lang.String
getProcessDefinitionId()
java.util.List<java.lang.String>
getProcessInstanceIds()
ProcessInstanceQuery
getProcessInstanceQuery()
boolean
isSkipCustomListeners()
boolean
isSkipIoMappings()
ModificationBuilder
processInstanceIds(java.lang.String... processInstanceIds)
ModificationBuilder
processInstanceIds(java.util.List<java.lang.String> processInstanceIds)
ModificationBuilder
processInstanceQuery(ProcessInstanceQuery processInstanceQuery)
ModificationBuilder
setAnnotation(java.lang.String annotation)
Provides annotation for the current modification.void
setAnnotationInternal(java.lang.String annotation)
void
setInstructions(java.util.List<AbstractProcessInstanceModificationCommand> instructions)
void
setProcessDefinitionId(java.lang.String processDefinitionId)
ModificationBuilder
skipCustomListeners()
Skips custom execution listeners when creating/removing activity instances during modificationModificationBuilder
skipIoMappings()
Skips io mappings when creating/removing activity instances during modificationModificationBuilder
startAfterActivity(java.lang.String activityId)
Submits an instruction that behaves likeInstantiationBuilder.startTransition(String)
and always instantiates the single outgoing sequence flow of the given activity.ModificationBuilder
startBeforeActivity(java.lang.String activityId)
Submits the instruction:ModificationBuilder
startTransition(java.lang.String transitionId)
Submits the instruction:
-
-
-
Field Detail
-
commandExecutor
protected CommandExecutor commandExecutor
-
processInstanceQuery
protected ProcessInstanceQuery processInstanceQuery
-
processInstanceIds
protected java.util.List<java.lang.String> processInstanceIds
-
instructions
protected java.util.List<AbstractProcessInstanceModificationCommand> instructions
-
processDefinitionId
protected java.lang.String processDefinitionId
-
skipCustomListeners
protected boolean skipCustomListeners
-
skipIoMappings
protected boolean skipIoMappings
-
annotation
protected java.lang.String annotation
-
-
Constructor Detail
-
ModificationBuilderImpl
public ModificationBuilderImpl(CommandExecutor commandExecutor, java.lang.String processDefinitionId)
-
-
Method Detail
-
startBeforeActivity
public ModificationBuilder startBeforeActivity(java.lang.String activityId)
Description copied from interface:InstantiationBuilder
Submits 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:
startBeforeActivity
in interfaceInstantiationBuilder<ModificationBuilder>
- Parameters:
activityId
- the activity to instantiate
-
startAfterActivity
public ModificationBuilder startAfterActivity(java.lang.String activityId)
Description copied from interface:InstantiationBuilder
Submits 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:
startAfterActivity
in interfaceInstantiationBuilder<ModificationBuilder>
- Parameters:
activityId
- the activity for which the outgoing flow should be executed
-
startTransition
public ModificationBuilder startTransition(java.lang.String transitionId)
Description copied from interface:InstantiationBuilder
Submits 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:
startTransition
in interfaceInstantiationBuilder<ModificationBuilder>
- Parameters:
transitionId
- the sequence flow to execute
-
cancelAllForActivity
public ModificationBuilder cancelAllForActivity(java.lang.String activityId)
Description copied from interface:ModificationBuilder
Submits 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
The cancellation order of the instances is arbitrary
- Specified by:
cancelAllForActivity
in interfaceModificationBuilder
- Parameters:
activityId
- the activity for which all instances should be cancelled
-
cancelAllForActivity
public ModificationBuilder cancelAllForActivity(java.lang.String activityId, boolean cancelCurrentActiveActivityInstances)
Description copied from interface:ModificationBuilder
Submits 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
The cancellation order of the instances is arbitrary
- Specified by:
cancelAllForActivity
in interfaceModificationBuilder
- Parameters:
activityId
- the activity for which all instances should be cancelled
-
processInstanceIds
public ModificationBuilder processInstanceIds(java.util.List<java.lang.String> processInstanceIds)
- Specified by:
processInstanceIds
in interfaceModificationBuilder
- Parameters:
processInstanceIds
- the process instance ids to modify.
-
processInstanceIds
public ModificationBuilder processInstanceIds(java.lang.String... processInstanceIds)
- Specified by:
processInstanceIds
in interfaceModificationBuilder
- Parameters:
processInstanceIds
- the process instance ids to modify.
-
processInstanceQuery
public ModificationBuilder processInstanceQuery(ProcessInstanceQuery processInstanceQuery)
- Specified by:
processInstanceQuery
in interfaceModificationBuilder
- Parameters:
processInstanceQuery
- a query which selects the process instances to modify. Query results are restricted to process instances for which the user hasPermissions.READ
permission.
-
skipCustomListeners
public ModificationBuilder skipCustomListeners()
Description copied from interface:ModificationBuilder
Skips custom execution listeners when creating/removing activity instances during modification- Specified by:
skipCustomListeners
in interfaceModificationBuilder
-
skipIoMappings
public ModificationBuilder skipIoMappings()
Description copied from interface:ModificationBuilder
Skips io mappings when creating/removing activity instances during modification- Specified by:
skipIoMappings
in interfaceModificationBuilder
-
setAnnotation
public ModificationBuilder setAnnotation(java.lang.String annotation)
Description copied from interface:ModificationBuilder
Provides annotation for the current modification.- Specified by:
setAnnotation
in interfaceModificationBuilder
-
execute
public void execute(boolean writeUserOperationLog)
-
execute
public void execute()
Description copied from interface:ModificationBuilder
Execute the modification synchronously.- Specified by:
execute
in interfaceModificationBuilder
-
executeAsync
public Batch executeAsync()
Description copied from interface:ModificationBuilder
Execute the modification asynchronously as batch. The returned batch can be used to track the progress of the modification.- Specified by:
executeAsync
in interfaceModificationBuilder
- Returns:
- the batch which executes the modification asynchronously.
-
getCommandExecutor
public CommandExecutor getCommandExecutor()
-
getProcessInstanceQuery
public ProcessInstanceQuery getProcessInstanceQuery()
-
getProcessInstanceIds
public java.util.List<java.lang.String> getProcessInstanceIds()
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
-
setProcessDefinitionId
public void setProcessDefinitionId(java.lang.String processDefinitionId)
-
getInstructions
public java.util.List<AbstractProcessInstanceModificationCommand> getInstructions()
-
setInstructions
public void setInstructions(java.util.List<AbstractProcessInstanceModificationCommand> instructions)
-
isSkipCustomListeners
public boolean isSkipCustomListeners()
-
isSkipIoMappings
public boolean isSkipIoMappings()
-
getAnnotation
public java.lang.String getAnnotation()
-
setAnnotationInternal
public void setAnnotationInternal(java.lang.String annotation)
-
-