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 java.lang.Object implements RestartProcessInstanceBuilder
- Author:
- Anna Pazola
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandExecutor
commandExecutor
protected boolean
initialVariables
protected java.util.List<AbstractProcessInstanceModificationCommand>
instructions
protected java.lang.String
processDefinitionId
protected java.util.List<java.lang.String>
processInstanceIds
protected HistoricProcessInstanceQuery
query
protected boolean
skipCustomListeners
protected boolean
skipIoMappings
protected boolean
withoutBusinessKey
-
Constructor Summary
Constructors Constructor Description RestartProcessInstanceBuilderImpl(java.lang.String processDefinitionId)
RestartProcessInstanceBuilderImpl(CommandExecutor commandExecutor, java.lang.String processDefinitionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
Executes the restart synchronously.Batch
executeAsync()
Executes the restart asynchronously as batch.HistoricProcessInstanceQuery
getHistoricProcessInstanceQuery()
java.util.List<AbstractProcessInstanceModificationCommand>
getInstructions()
java.lang.String
getProcessDefinitionId()
java.util.List<java.lang.String>
getProcessInstanceIds()
RestartProcessInstanceBuilder
historicProcessInstanceQuery(HistoricProcessInstanceQuery query)
RestartProcessInstanceBuilder
initialSetOfVariables()
Sets the initial set of variables during restart.boolean
isInitialVariables()
boolean
isSkipCustomListeners()
boolean
isSkipIoMappings()
boolean
isWithoutBusinessKey()
RestartProcessInstanceBuilder
processInstanceIds(java.lang.String... processInstanceIds)
RestartProcessInstanceBuilder
processInstanceIds(java.util.List<java.lang.String> processInstanceIds)
void
setInstructions(java.util.List<AbstractProcessInstanceModificationCommand> instructions)
void
setProcessDefinitionId(java.lang.String processDefinitionId)
RestartProcessInstanceBuilder
skipCustomListeners()
Skips custom execution listeners when creating activity instances during restartRestartProcessInstanceBuilder
skipIoMappings()
Skips io mappings when creating activity instances during restartRestartProcessInstanceBuilder
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.RestartProcessInstanceBuilder
startBeforeActivity(java.lang.String activityId)
Submits the instruction:RestartProcessInstanceBuilder
startTransition(java.lang.String transitionId)
Submits the instruction:RestartProcessInstanceBuilder
withoutBusinessKey()
Does not take over the business key of the historic process instance
-
-
-
Field Detail
-
commandExecutor
protected CommandExecutor commandExecutor
-
processInstanceIds
protected java.util.List<java.lang.String> processInstanceIds
-
instructions
protected java.util.List<AbstractProcessInstanceModificationCommand> instructions
-
processDefinitionId
protected java.lang.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, java.lang.String processDefinitionId)
-
RestartProcessInstanceBuilderImpl
public RestartProcessInstanceBuilderImpl(java.lang.String processDefinitionId)
-
-
Method Detail
-
startBeforeActivity
public RestartProcessInstanceBuilder 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<RestartProcessInstanceBuilder>
- Parameters:
activityId
- the activity to instantiate
-
startAfterActivity
public RestartProcessInstanceBuilder 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<RestartProcessInstanceBuilder>
- Parameters:
activityId
- the activity for which the outgoing flow should be executed
-
startTransition
public RestartProcessInstanceBuilder 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<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 java.util.List<AbstractProcessInstanceModificationCommand> getInstructions()
-
getProcessInstanceIds
public java.util.List<java.lang.String> getProcessInstanceIds()
-
processInstanceIds
public RestartProcessInstanceBuilder processInstanceIds(java.lang.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 java.lang.String getProcessDefinitionId()
-
setInstructions
public void setInstructions(java.util.List<AbstractProcessInstanceModificationCommand> instructions)
-
setProcessDefinitionId
public void setProcessDefinitionId(java.lang.String processDefinitionId)
-
processInstanceIds
public RestartProcessInstanceBuilder processInstanceIds(java.util.List<java.lang.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()
-
-