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
Fields Modifier and Type Field Description protected CommandExecutor
commandExecutor
protected boolean
initialVariables
protected List<AbstractProcessInstanceModificationCommand>
instructions
protected String
processDefinitionId
protected List<String>
processInstanceIds
protected HistoricProcessInstanceQuery
query
protected boolean
skipCustomListeners
protected boolean
skipIoMappings
protected boolean
withoutBusinessKey
-
Constructor Summary
Constructors Constructor Description RestartProcessInstanceBuilderImpl(String processDefinitionId)
RestartProcessInstanceBuilderImpl(CommandExecutor commandExecutor, String processDefinitionId)
-
Method Summary
-
-
-
Field Detail
-
commandExecutor
protected CommandExecutor commandExecutor
-
instructions
protected List<AbstractProcessInstanceModificationCommand> instructions
-
processDefinitionId
protected String processDefinitionId
-
query
protected HistoricProcessInstanceQuery query
-
initialVariables
protected boolean initialVariables
-
skipCustomListeners
protected boolean skipCustomListeners
-
skipIoMappings
protected boolean skipIoMappings
-
withoutBusinessKey
protected boolean withoutBusinessKey
-
-
Constructor Detail
-
RestartProcessInstanceBuilderImpl
public RestartProcessInstanceBuilderImpl(CommandExecutor commandExecutor, String processDefinitionId)
-
RestartProcessInstanceBuilderImpl
public RestartProcessInstanceBuilderImpl(String processDefinitionId)
-
-
Method Detail
-
startBeforeActivity
public RestartProcessInstanceBuilder 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<RestartProcessInstanceBuilder>
- Parameters:
activityId
- the activity to instantiate
-
startAfterActivity
public RestartProcessInstanceBuilder 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<RestartProcessInstanceBuilder>
- Parameters:
activityId
- the activity for which the outgoing flow should be executed
-
startTransition
public RestartProcessInstanceBuilder 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<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
public Batch 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
public List<AbstractProcessInstanceModificationCommand> getInstructions()
-
processInstanceIds
public RestartProcessInstanceBuilder processInstanceIds(String... 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
public HistoricProcessInstanceQuery getHistoricProcessInstanceQuery()
-
getProcessDefinitionId
public String getProcessDefinitionId()
-
setInstructions
public void setInstructions(List<AbstractProcessInstanceModificationCommand> instructions)
-
setProcessDefinitionId
public void setProcessDefinitionId(String processDefinitionId)
-
processInstanceIds
public RestartProcessInstanceBuilder processInstanceIds(List<String> processInstanceIds)
- Specified by:
processInstanceIds
in interfaceRestartProcessInstanceBuilder
- Parameters:
processInstanceIds
- the process instance ids to restart.
-
initialSetOfVariables
public RestartProcessInstanceBuilder 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
public RestartProcessInstanceBuilder skipCustomListeners()
Description copied from interface:RestartProcessInstanceBuilder
Skips custom execution listeners when creating activity instances during restart- Specified by:
skipCustomListeners
in interfaceRestartProcessInstanceBuilder
-
skipIoMappings
public RestartProcessInstanceBuilder 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
public RestartProcessInstanceBuilder 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()
-
-