Package org.camunda.bpm.engine.impl
Class RestartProcessInstanceBuilderImpl
java.lang.Object
org.camunda.bpm.engine.impl.RestartProcessInstanceBuilderImpl
- All Implemented Interfaces:
InstantiationBuilder<RestartProcessInstanceBuilder>
,RestartProcessInstanceBuilder
public class RestartProcessInstanceBuilderImpl
extends Object
implements RestartProcessInstanceBuilder
- Author:
- Anna Pazola
-
Field Summary
Modifier and TypeFieldDescriptionprotected CommandExecutor
protected boolean
protected List<AbstractProcessInstanceModificationCommand>
protected String
protected HistoricProcessInstanceQuery
protected boolean
protected boolean
protected boolean
-
Constructor Summary
ConstructorDescriptionRestartProcessInstanceBuilderImpl
(String processDefinitionId) RestartProcessInstanceBuilderImpl
(CommandExecutor commandExecutor, String processDefinitionId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
Executes the restart synchronously.Executes the restart asynchronously as batch.Sets the initial set of variables during restart.boolean
boolean
boolean
boolean
processInstanceIds
(String... processInstanceIds) processInstanceIds
(List<String> processInstanceIds) void
setInstructions
(List<AbstractProcessInstanceModificationCommand> instructions) void
setProcessDefinitionId
(String processDefinitionId) Skips custom execution listeners when creating activity instances during restartSkips io mappings when creating activity instances during restartstartAfterActivity
(String activityId) Submits an instruction that behaves likeInstantiationBuilder.startTransition(String)
and always instantiates the single outgoing sequence flow of the given activity.startBeforeActivity
(String activityId) Submits the instruction:startTransition
(String transitionId) Submits the instruction:Does not take over the business key of the historic process instance
-
Field Details
-
commandExecutor
-
processInstanceIds
-
instructions
-
processDefinitionId
-
query
-
initialVariables
protected boolean initialVariables -
skipCustomListeners
protected boolean skipCustomListeners -
skipIoMappings
protected boolean skipIoMappings -
withoutBusinessKey
protected boolean withoutBusinessKey
-
-
Constructor Details
-
RestartProcessInstanceBuilderImpl
public RestartProcessInstanceBuilderImpl(CommandExecutor commandExecutor, String processDefinitionId) -
RestartProcessInstanceBuilderImpl
-
-
Method Details
-
startBeforeActivity
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<RestartProcessInstanceBuilder>
- Parameters:
activityId
- the activity to instantiate
-
startAfterActivity
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<RestartProcessInstanceBuilder>
- Parameters:
activityId
- the activity for which the outgoing flow should be executed
-
startTransition
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<RestartProcessInstanceBuilder>
- Parameters:
transitionId
- the sequence flow to execute
-
execute
public void execute()Description copied from interface:RestartProcessInstanceBuilder
Executes the restart synchronously.- Specified by:
execute
in interfaceRestartProcessInstanceBuilder
-
executeAsync
Description copied from interface:RestartProcessInstanceBuilder
Executes the restart asynchronously as batch. The returned batch can be used to track the progress of the restart.- Specified by:
executeAsync
in interfaceRestartProcessInstanceBuilder
- Returns:
- the batch which executes the restart asynchronously.
-
getInstructions
-
getProcessInstanceIds
-
processInstanceIds
- Specified by:
processInstanceIds
in interfaceRestartProcessInstanceBuilder
- Parameters:
processInstanceIds
- the process instance ids to restart.
-
historicProcessInstanceQuery
public RestartProcessInstanceBuilder historicProcessInstanceQuery(HistoricProcessInstanceQuery query) - Specified by:
historicProcessInstanceQuery
in interfaceRestartProcessInstanceBuilder
- Parameters:
query
- a query which selects the historic process instances to restart. Query results are restricted to process instances for which the user hasPermissions.READ_HISTORY
permission.
-
getHistoricProcessInstanceQuery
-
getProcessDefinitionId
-
setInstructions
-
setProcessDefinitionId
-
processInstanceIds
- Specified by:
processInstanceIds
in interfaceRestartProcessInstanceBuilder
- Parameters:
processInstanceIds
- the process instance ids to restart.
-
initialSetOfVariables
Description copied from interface:RestartProcessInstanceBuilder
Sets the initial set of variables during restart. By default, the last set of variables is used- Specified by:
initialSetOfVariables
in interfaceRestartProcessInstanceBuilder
-
isInitialVariables
public boolean isInitialVariables() -
skipCustomListeners
Description copied from interface:RestartProcessInstanceBuilder
Skips custom execution listeners when creating activity instances during restart- Specified by:
skipCustomListeners
in interfaceRestartProcessInstanceBuilder
-
skipIoMappings
Description copied from interface:RestartProcessInstanceBuilder
Skips io mappings when creating activity instances during restart- Specified by:
skipIoMappings
in interfaceRestartProcessInstanceBuilder
-
isSkipCustomListeners
public boolean isSkipCustomListeners() -
isSkipIoMappings
public boolean isSkipIoMappings() -
withoutBusinessKey
Description copied from interface:RestartProcessInstanceBuilder
Does not take over the business key of the historic process instance- Specified by:
withoutBusinessKey
in interfaceRestartProcessInstanceBuilder
-
isWithoutBusinessKey
public boolean isWithoutBusinessKey()
-