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
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected CommandExecutorprotected booleanprotected ProcessInstanceModificationBuilderImplprotected Stringprotected Stringprotected Stringprotected Stringprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProcessInstantiationBuilderImpl(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 ProcessInstantiationBuildercreateProcessInstanceById(CommandExecutor commandExecutor, String processDefinitionId) static ProcessInstantiationBuildercreateProcessInstanceByKey(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.booleanprocessDefinitionTenantId(String tenantId) Specify the id of the tenant the process definition belongs to.Specify that the process definition belongs to no tenant.voidsetModificationBuilder(ProcessInstanceModificationBuilderImpl modificationBuilder) voidsetRestartedProcessInstanceId(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: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<ProcessInstantiationBuilder>- Parameters:
activityId- the activity to instantiate
-
startAfterActivity
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<ProcessInstantiationBuilder>- Parameters:
activityId- the activity for which the outgoing flow should be executed
-
startTransition
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<ProcessInstantiationBuilder>- Parameters:
transitionId- the sequence flow to execute
-
setVariable
Description copied from interface:ActivityInstantiationBuilderIf 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:
setVariablein interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
setVariableLocal
Description copied from interface:ActivityInstantiationBuilderIf 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:
setVariableLocalin interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
setVariables
Description copied from interface:ActivityInstantiationBuilderIf 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:
setVariablesin interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
setVariablesLocal
Description copied from interface:ActivityInstantiationBuilderIf 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:
setVariablesLocalin interfaceActivityInstantiationBuilder<ProcessInstantiationBuilder>
-
businessKey
Description copied from interface:ProcessInstantiationBuilderSet the business key for the process instance- Specified by:
businessKeyin interfaceProcessInstantiationBuilder
-
caseInstanceId
Description copied from interface:ProcessInstantiationBuilderAssociate a case instance with the process instance- Specified by:
caseInstanceIdin interfaceProcessInstantiationBuilder
-
tenantId
-
processDefinitionTenantId
Description copied from interface:ProcessInstantiationBuilderSpecify the id of the tenant the process definition belongs to. Can only be used when the definition is referenced bykeyand not byid.- Specified by:
processDefinitionTenantIdin interfaceProcessInstantiationBuilder
-
processDefinitionWithoutTenantId
Description copied from interface:ProcessInstantiationBuilderSpecify that the process definition belongs to no tenant. Can only be used when the definition is referenced bykeyand not byid.- Specified by:
processDefinitionWithoutTenantIdin interfaceProcessInstantiationBuilder
-
execute
Description copied from interface:ProcessInstantiationBuilderStart the process instance.- Specified by:
executein interfaceProcessInstantiationBuilder- Returns:
- the newly created process instance
- See Also:
-
#executeWithVariablesInReturn().
-
execute
Description copied from interface:ProcessInstantiationBuilderStart the process instance.- Specified by:
executein 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:ProcessInstantiationBuilderStart 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:
executeWithVariablesInReturnin interfaceProcessInstantiationBuilder- Returns:
- the newly created process instance with the latest variables
-
executeWithVariablesInReturn
public ProcessInstanceWithVariables executeWithVariablesInReturn(boolean skipCustomListeners, boolean skipIoMappings) Description copied from interface:ProcessInstantiationBuilderStart 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:
executeWithVariablesInReturnin 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)
-