Package org.camunda.bpm.engine.impl
Class ProcessInstantiationBuilderImpl
java.lang.Object
org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl
- All Implemented Interfaces:
ActivityInstantiationBuilder<ProcessInstantiationBuilder>
,InstantiationBuilder<ProcessInstantiationBuilder>
,ProcessInstantiationBuilder
Simply wraps a modification builder because their API is equivalent.
- Author:
- Thorben Lindhauer
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected String
protected CommandExecutor
protected boolean
protected ProcessInstanceModificationBuilderImpl
protected String
protected String
protected String
protected String
protected String
-
Constructor Summary
ModifierConstructorDescriptionprotected
ProcessInstantiationBuilderImpl
(CommandExecutor commandExecutor) -
Method Summary
Modifier and TypeMethodDescriptionbusinessKey
(String businessKey) Set the business key for the process instancecaseInstanceId
(String caseInstanceId) Associate a case instance with the process instancestatic ProcessInstantiationBuilder
createProcessInstanceById
(CommandExecutor commandExecutor, String processDefinitionId) static ProcessInstantiationBuilder
createProcessInstanceByKey
(CommandExecutor commandExecutor, String processDefinitionKey) execute()
Start the process instance.execute
(boolean skipCustomListeners, boolean skipIoMappings) Start the process instance.Start the process instance.executeWithVariablesInReturn
(boolean skipCustomListeners, boolean skipIoMappings) Start the process instance.boolean
processDefinitionTenantId
(String tenantId) Specify the id of the tenant the process definition belongs to.Specify that the process definition belongs to no tenant.void
setModificationBuilder
(ProcessInstanceModificationBuilderImpl modificationBuilder) void
setRestartedProcessInstanceId
(String restartedProcessInstanceId) setVariable
(String name, Object value) If an instruction is submitted before then the variable is set when the instruction is executed.setVariableLocal
(String name, Object value) If an instruction is submitted before then the local variable is set when the instruction is executed.setVariables
(Map<String, Object> variables) If an instruction is submitted before then all variables are set when the instruction is executed.setVariablesLocal
(Map<String, Object> variables) If an instruction is submitted before then all local variables are set when the instruction is executed.startAfterActivity
(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:
-
Field Details
-
commandExecutor
-
processDefinitionId
-
processDefinitionKey
-
businessKey
-
caseInstanceId
-
tenantId
-
processDefinitionTenantId
-
isProcessDefinitionTenantIdSet
protected boolean isProcessDefinitionTenantIdSet -
restartedProcessInstanceId
-
modificationBuilder
-
-
Constructor Details
-
ProcessInstantiationBuilderImpl
-
-
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<ProcessInstantiationBuilder>
- 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<ProcessInstantiationBuilder>
- 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<ProcessInstantiationBuilder>
- Parameters:
transitionId
- the sequence flow to execute
-
setVariable
Description copied from interface:ActivityInstantiationBuilder
If an instruction is submitted before then the variable is set when the instruction is executed. Otherwise, the variable is set on the process instance itself.- Specified by:
setVariable
in interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
setVariableLocal
Description copied from interface:ActivityInstantiationBuilder
If an instruction is submitted before then the local variable is set when the instruction is executed. Otherwise, the variable is set on the process instance itself.- Specified by:
setVariableLocal
in interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
setVariables
Description copied from interface:ActivityInstantiationBuilder
If an instruction is submitted before then all variables are set when the instruction is executed. Otherwise, the variables are set on the process instance itself.- Specified by:
setVariables
in interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
setVariablesLocal
Description copied from interface:ActivityInstantiationBuilder
If an instruction is submitted before then all local variables are set when the instruction is executed. Otherwise, the variables are set on the process instance itself.- Specified by:
setVariablesLocal
in interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
businessKey
Description copied from interface:ProcessInstantiationBuilder
Set the business key for the process instance- Specified by:
businessKey
in interfaceProcessInstantiationBuilder
-
caseInstanceId
Description copied from interface:ProcessInstantiationBuilder
Associate a case instance with the process instance- Specified by:
caseInstanceId
in interfaceProcessInstantiationBuilder
-
tenantId
-
processDefinitionTenantId
Description copied from interface:ProcessInstantiationBuilder
Specify the id of the tenant the process definition belongs to. Can only be used when the definition is referenced bykey
and not byid
.- Specified by:
processDefinitionTenantId
in interfaceProcessInstantiationBuilder
-
processDefinitionWithoutTenantId
Description copied from interface:ProcessInstantiationBuilder
Specify that the process definition belongs to no tenant. Can only be used when the definition is referenced bykey
and not byid
.- Specified by:
processDefinitionWithoutTenantId
in interfaceProcessInstantiationBuilder
-
execute
Description copied from interface:ProcessInstantiationBuilder
Start the process instance.- Specified by:
execute
in interfaceProcessInstantiationBuilder
- Returns:
- the newly created process instance
- See Also:
-
#executeWithVariablesInReturn().
-
execute
Description copied from interface:ProcessInstantiationBuilder
Start the process instance.- Specified by:
execute
in interfaceProcessInstantiationBuilder
- Parameters:
skipCustomListeners
- specifies whether custom listeners (task and execution) should be invoked when executing the instructions. Only supported for instructions.skipIoMappings
- specifies whether input/output mappings for tasks should be invoked throughout the transaction when executing the instructions. Only supported for instructions.- Returns:
- the newly created process instance
- See Also:
-
#executeWithVariablesInReturn(boolean, boolean).
-
executeWithVariablesInReturn
Description copied from interface:ProcessInstantiationBuilder
Start the process instance. If no instantiation instructions are set then the instance start at the default start activity. Otherwise, all instructions are executed in the order they are submitted. Custom execution and task listeners, as well as task input output mappings are triggered.- Specified by:
executeWithVariablesInReturn
in interfaceProcessInstantiationBuilder
- Returns:
- the newly created process instance with the latest variables
-
executeWithVariablesInReturn
public ProcessInstanceWithVariables executeWithVariablesInReturn(boolean skipCustomListeners, boolean skipIoMappings) Description copied from interface:ProcessInstantiationBuilder
Start the process instance. If no instantiation instructions are set then the instance start at the default start activity. Otherwise, all instructions are executed in the order they are submitted.- Specified by:
executeWithVariablesInReturn
in interfaceProcessInstantiationBuilder
- Parameters:
skipCustomListeners
- specifies whether custom listeners (task and execution) should be invoked when executing the instructions. Only supported for instructions.skipIoMappings
- specifies whether input/output mappings for tasks should be invoked throughout the transaction when executing the instructions. Only supported for instructions.- Returns:
- the newly created process instance with the latest variables
-
getProcessDefinitionId
-
getProcessDefinitionKey
-
getModificationBuilder
-
getBusinessKey
-
getCaseInstanceId
-
getVariables
-
getTenantId
-
getProcessDefinitionTenantId
-
isProcessDefinitionTenantIdSet
public boolean isProcessDefinitionTenantIdSet() -
setModificationBuilder
-
setRestartedProcessInstanceId
-
getRestartedProcessInstanceId
-
createProcessInstanceById
public static ProcessInstantiationBuilder createProcessInstanceById(CommandExecutor commandExecutor, String processDefinitionId) -
createProcessInstanceByKey
public static ProcessInstantiationBuilder createProcessInstanceByKey(CommandExecutor commandExecutor, String processDefinitionKey)
-