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 CommandExecutorcommandExecutorprotected booleaninitialVariablesprotected List<AbstractProcessInstanceModificationCommand>instructionsprotected StringprocessDefinitionIdprotected List<String>processInstanceIdsprotected HistoricProcessInstanceQueryqueryprotected booleanskipCustomListenersprotected booleanskipIoMappingsprotected booleanwithoutBusinessKey
-
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: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 interfaceInstantiationBuilder<RestartProcessInstanceBuilder>- Parameters:
activityId- the activity to instantiate
-
startAfterActivity
public RestartProcessInstanceBuilder startAfterActivity(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 interfaceInstantiationBuilder<RestartProcessInstanceBuilder>- Parameters:
activityId- the activity for which the outgoing flow should be executed
-
startTransition
public RestartProcessInstanceBuilder startTransition(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 interfaceInstantiationBuilder<RestartProcessInstanceBuilder>- Parameters:
transitionId- the sequence flow to execute
-
execute
public void execute()
Description copied from interface:RestartProcessInstanceBuilderExecutes the restart synchronously.- Specified by:
executein interfaceRestartProcessInstanceBuilder
-
executeAsync
public Batch executeAsync()
Description copied from interface:RestartProcessInstanceBuilderExecutes the restart asynchronously as batch. The returned batch can be used to track the progress of the restart.- Specified by:
executeAsyncin interfaceRestartProcessInstanceBuilder- Returns:
- the batch which executes the restart asynchronously.
-
getInstructions
public List<AbstractProcessInstanceModificationCommand> getInstructions()
-
processInstanceIds
public RestartProcessInstanceBuilder processInstanceIds(String... processInstanceIds)
- Specified by:
processInstanceIdsin interfaceRestartProcessInstanceBuilder- Parameters:
processInstanceIds- the process instance ids to restart.
-
historicProcessInstanceQuery
public RestartProcessInstanceBuilder historicProcessInstanceQuery(HistoricProcessInstanceQuery query)
- Specified by:
historicProcessInstanceQueryin 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_HISTORYpermission.
-
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:
processInstanceIdsin interfaceRestartProcessInstanceBuilder- Parameters:
processInstanceIds- the process instance ids to restart.
-
initialSetOfVariables
public RestartProcessInstanceBuilder initialSetOfVariables()
Description copied from interface:RestartProcessInstanceBuilderSets the initial set of variables during restart. By default, the last set of variables is used- Specified by:
initialSetOfVariablesin interfaceRestartProcessInstanceBuilder
-
isInitialVariables
public boolean isInitialVariables()
-
skipCustomListeners
public RestartProcessInstanceBuilder skipCustomListeners()
Description copied from interface:RestartProcessInstanceBuilderSkips custom execution listeners when creating activity instances during restart- Specified by:
skipCustomListenersin interfaceRestartProcessInstanceBuilder
-
skipIoMappings
public RestartProcessInstanceBuilder skipIoMappings()
Description copied from interface:RestartProcessInstanceBuilderSkips io mappings when creating activity instances during restart- Specified by:
skipIoMappingsin interfaceRestartProcessInstanceBuilder
-
isSkipCustomListeners
public boolean isSkipCustomListeners()
-
isSkipIoMappings
public boolean isSkipIoMappings()
-
withoutBusinessKey
public RestartProcessInstanceBuilder withoutBusinessKey()
Description copied from interface:RestartProcessInstanceBuilderDoes not take over the business key of the historic process instance- Specified by:
withoutBusinessKeyin interfaceRestartProcessInstanceBuilder
-
isWithoutBusinessKey
public boolean isWithoutBusinessKey()
-
-