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 Object implements ModificationBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected String
annotation
protected CommandExecutor
commandExecutor
protected List<AbstractProcessInstanceModificationCommand>
instructions
protected String
processDefinitionId
protected List<String>
processInstanceIds
protected ProcessInstanceQuery
processInstanceQuery
protected boolean
skipCustomListeners
protected boolean
skipIoMappings
-
Constructor Summary
Constructors Constructor Description ModificationBuilderImpl(CommandExecutor commandExecutor, String processDefinitionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModificationBuilder
cancelAllForActivity(String activityId)
Submits the instruction:ModificationBuilder
cancelAllForActivity(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.String
getAnnotation()
CommandExecutor
getCommandExecutor()
List<AbstractProcessInstanceModificationCommand>
getInstructions()
String
getProcessDefinitionId()
List<String>
getProcessInstanceIds()
ProcessInstanceQuery
getProcessInstanceQuery()
boolean
isSkipCustomListeners()
boolean
isSkipIoMappings()
ModificationBuilder
processInstanceIds(String... processInstanceIds)
ModificationBuilder
processInstanceIds(List<String> processInstanceIds)
ModificationBuilder
processInstanceQuery(ProcessInstanceQuery processInstanceQuery)
ModificationBuilder
setAnnotation(String annotation)
Provides annotation for the current modification.void
setAnnotationInternal(String annotation)
void
setInstructions(List<AbstractProcessInstanceModificationCommand> instructions)
void
setProcessDefinitionId(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(String activityId)
Submits an instruction that behaves likeInstantiationBuilder.startTransition(String)
and always instantiates the single outgoing sequence flow of the given activity.ModificationBuilder
startBeforeActivity(String activityId)
Submits the instruction:ModificationBuilder
startTransition(String transitionId)
Submits the instruction:
-
-
-
Field Detail
-
commandExecutor
protected CommandExecutor commandExecutor
-
processInstanceQuery
protected ProcessInstanceQuery processInstanceQuery
-
instructions
protected List<AbstractProcessInstanceModificationCommand> instructions
-
processDefinitionId
protected String processDefinitionId
-
skipCustomListeners
protected boolean skipCustomListeners
-
skipIoMappings
protected boolean skipIoMappings
-
annotation
protected String annotation
-
-
Constructor Detail
-
ModificationBuilderImpl
public ModificationBuilderImpl(CommandExecutor commandExecutor, String processDefinitionId)
-
-
Method Detail
-
startBeforeActivity
public ModificationBuilder startBeforeActivity(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(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(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(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(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(List<String> processInstanceIds)
- Specified by:
processInstanceIds
in interfaceModificationBuilder
- Parameters:
processInstanceIds
- the process instance ids to modify.
-
processInstanceIds
public ModificationBuilder processInstanceIds(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(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()
-
getProcessDefinitionId
public String getProcessDefinitionId()
-
setProcessDefinitionId
public void setProcessDefinitionId(String processDefinitionId)
-
getInstructions
public List<AbstractProcessInstanceModificationCommand> getInstructions()
-
setInstructions
public void setInstructions(List<AbstractProcessInstanceModificationCommand> instructions)
-
isSkipCustomListeners
public boolean isSkipCustomListeners()
-
isSkipIoMappings
public boolean isSkipIoMappings()
-
getAnnotation
public String getAnnotation()
-
setAnnotationInternal
public void setAnnotationInternal(String annotation)
-
-