Package org.flowable.engine.impl.runtime
Class ProcessInstanceBuilderImpl
- java.lang.Object
-
- org.flowable.engine.impl.runtime.ProcessInstanceBuilderImpl
-
- All Implemented Interfaces:
ProcessInstanceBuilder
public class ProcessInstanceBuilderImpl extends Object implements ProcessInstanceBuilder
- Author:
- Bassam Al-Sarori, Joram Barrez
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ProcessInstanceBuilderImpl(RuntimeServiceImpl runtimeService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessInstanceBuilderassignee(String userId)Set the assignee of the process instance to be created to the given user id.ProcessInstanceBuilderbusinessKey(String businessKey)Set the businessKey of process instanceProcessInstanceBuilderbusinessStatus(String businessStatus)Set the businessStatus of process instanceProcessInstanceBuildercallbackId(String callbackId)Sets the callback identifier of the process instance.ProcessInstanceBuildercallbackType(String callbackType)Sets the callback type of the process instance.ProcessInstanceBuilderfallbackToDefaultTenant()Use default tenant as a fallback in the case when process definition was not found by key and tenant idProcessInstanceBuilderformVariables(Map<String,Object> formVariables, FormInfo formInfo, String formOutcome)Start the process instance with the given form variables from the givenformInfo.StringgetAssigneeId()StringgetBusinessKey()StringgetBusinessStatus()StringgetCallbackId()StringgetCallbackType()FormInfogetExtraFormInfo()StringgetExtraFormOutcome()Map<String,Object>getExtraFormVariables()StringgetMessageName()StringgetOutcome()StringgetOverrideDefinitionTenantId()StringgetOwnerId()StringgetPredefinedProcessInstanceId()StringgetProcessDefinitionId()StringgetProcessDefinitionKey()StringgetProcessDefinitionParentDeploymentId()StringgetProcessInstanceName()StringgetReferenceId()StringgetReferenceType()StringgetStageInstanceId()StringgetStartEventId()Map<String,Object>getStartFormVariables()StringgetTenantId()Map<String,Object>getTransientVariables()Map<String,Object>getVariables()booleanisFallbackToDefaultTenant()ProcessInstanceBuildermessageName(String messageName)Set the message name that needs to be used to look up the process definition that needs to be used to start the process instance.ProcessInstanceBuildername(String processInstanceName)Set the name of process instanceProcessInstanceBuilderoutcome(String outcome)Allows to set an outcome for a start form.ProcessInstanceBuilderoverrideProcessDefinitionTenantId(String tenantId)Indicator to override the tenant id of the process definition with the provided value.ProcessInstanceBuilderowner(String userId)Set the owner of the process instance to be created to the given user id.ProcessInstanceBuilderpredefineProcessInstanceId(String processInstanceId)When starting a process instance from the CMMN engine process task, the process instance id needs to be known beforehand to store entity links and callback references before the process instance is started.ProcessInstanceBuilderprocessDefinitionId(String processDefinitionId)Set the id of the process definitionProcessInstanceBuilderprocessDefinitionKey(String processDefinitionKey)Set the key of the process definition, latest version of the process definition with the given key.ProcessInstanceBuilderprocessDefinitionParentDeploymentId(String parentDeploymentId)When looking up for a process definition by key it would first lookup for a process definition within the given parent deployment.ProcessInstanceBuilderreferenceId(String referenceId)Sets the reference identifier of the process instance.ProcessInstanceBuilderreferenceType(String referenceType)Sets the reference type of the process instance.ProcessInstanceBuilderstageInstanceId(String stageInstanceId)Set the optional instance id of the stage this process instance belongs to, if it runs in the context of a CMMN case.ProcessInstancestart()Start the process instanceProcessInstancestartAsync()Start the process instance asynchronouslyProcessInstanceBuilderstartEventId(String startEventId)Set the start event in case of an event registry start event that is triggered to start the process instance.ProcessInstanceBuilderstartFormVariable(String variableName, Object value)Adds one variable from a start form to the process instance.ProcessInstanceBuilderstartFormVariables(Map<String,Object> startFormVariables)Adds variables from a start form to the process instance.ProcessInstanceBuildertenantId(String tenantId)Set the tenantId of to lookup the process definitionProcessInstanceBuildertransientVariable(String variableName, Object value)Adds a transient variable to the process instanceProcessInstanceBuildertransientVariables(Map<String,Object> transientVariables)Sets the transient variablesProcessInstanceBuildervariable(String variableName, Object value)Adds a variable to the process instanceProcessInstanceBuildervariables(Map<String,Object> variables)Sets the process variables
-
-
-
Field Detail
-
runtimeService
protected RuntimeServiceImpl runtimeService
-
processDefinitionId
protected String processDefinitionId
-
processDefinitionKey
protected String processDefinitionKey
-
processDefinitionParentDeploymentId
protected String processDefinitionParentDeploymentId
-
messageName
protected String messageName
-
startEventId
protected String startEventId
-
processInstanceName
protected String processInstanceName
-
businessKey
protected String businessKey
-
businessStatus
protected String businessStatus
-
callbackId
protected String callbackId
-
callbackType
protected String callbackType
-
referenceId
protected String referenceId
-
referenceType
protected String referenceType
-
stageInstanceId
protected String stageInstanceId
-
tenantId
protected String tenantId
-
ownerId
protected String ownerId
-
assigneeId
protected String assigneeId
-
overrideDefinitionTenantId
protected String overrideDefinitionTenantId
-
predefinedProcessInstanceId
protected String predefinedProcessInstanceId
-
outcome
protected String outcome
-
extraFormInfo
protected FormInfo extraFormInfo
-
extraFormOutcome
protected String extraFormOutcome
-
fallbackToDefaultTenant
protected boolean fallbackToDefaultTenant
-
-
Constructor Detail
-
ProcessInstanceBuilderImpl
public ProcessInstanceBuilderImpl(RuntimeServiceImpl runtimeService)
-
-
Method Detail
-
processDefinitionId
public ProcessInstanceBuilder processDefinitionId(String processDefinitionId)
Description copied from interface:ProcessInstanceBuilderSet the id of the process definition- Specified by:
processDefinitionIdin interfaceProcessInstanceBuilder
-
processDefinitionParentDeploymentId
public ProcessInstanceBuilder processDefinitionParentDeploymentId(String parentDeploymentId)
Description copied from interface:ProcessInstanceBuilderWhen looking up for a process definition by key it would first lookup for a process definition within the given parent deployment. Then it would fallback to the latest process definition with the given key.This is typically needed when the ProcessInstanceBuilder is called for example from the case engine to start a process instance and it needs to look up the process definition in the same deployment as the case.
- Specified by:
processDefinitionParentDeploymentIdin interfaceProcessInstanceBuilder
-
processDefinitionKey
public ProcessInstanceBuilder processDefinitionKey(String processDefinitionKey)
Description copied from interface:ProcessInstanceBuilderSet the key of the process definition, latest version of the process definition with the given key. If processDefinitionId was set this will be ignored- Specified by:
processDefinitionKeyin interfaceProcessInstanceBuilder
-
messageName
public ProcessInstanceBuilder messageName(String messageName)
Description copied from interface:ProcessInstanceBuilderSet the message name that needs to be used to look up the process definition that needs to be used to start the process instance.- Specified by:
messageNamein interfaceProcessInstanceBuilder
-
startEventId
public ProcessInstanceBuilder startEventId(String startEventId)
Description copied from interface:ProcessInstanceBuilderSet the start event in case of an event registry start event that is triggered to start the process instance.- Specified by:
startEventIdin interfaceProcessInstanceBuilder
-
name
public ProcessInstanceBuilder name(String processInstanceName)
Description copied from interface:ProcessInstanceBuilderSet the name of process instance- Specified by:
namein interfaceProcessInstanceBuilder
-
businessKey
public ProcessInstanceBuilder businessKey(String businessKey)
Description copied from interface:ProcessInstanceBuilderSet the businessKey of process instance- Specified by:
businessKeyin interfaceProcessInstanceBuilder
-
businessStatus
public ProcessInstanceBuilder businessStatus(String businessStatus)
Description copied from interface:ProcessInstanceBuilderSet the businessStatus of process instance- Specified by:
businessStatusin interfaceProcessInstanceBuilder
-
callbackId
public ProcessInstanceBuilder callbackId(String callbackId)
Description copied from interface:ProcessInstanceBuilderSets the callback identifier of the process instance.- Specified by:
callbackIdin interfaceProcessInstanceBuilder
-
callbackType
public ProcessInstanceBuilder callbackType(String callbackType)
Description copied from interface:ProcessInstanceBuilderSets the callback type of the process instance.- Specified by:
callbackTypein interfaceProcessInstanceBuilder
-
referenceId
public ProcessInstanceBuilder referenceId(String referenceId)
Description copied from interface:ProcessInstanceBuilderSets the reference identifier of the process instance.- Specified by:
referenceIdin interfaceProcessInstanceBuilder
-
referenceType
public ProcessInstanceBuilder referenceType(String referenceType)
Description copied from interface:ProcessInstanceBuilderSets the reference type of the process instance.- Specified by:
referenceTypein interfaceProcessInstanceBuilder
-
stageInstanceId
public ProcessInstanceBuilder stageInstanceId(String stageInstanceId)
Description copied from interface:ProcessInstanceBuilderSet the optional instance id of the stage this process instance belongs to, if it runs in the context of a CMMN case.- Specified by:
stageInstanceIdin interfaceProcessInstanceBuilder
-
tenantId
public ProcessInstanceBuilder tenantId(String tenantId)
Description copied from interface:ProcessInstanceBuilderSet the tenantId of to lookup the process definition- Specified by:
tenantIdin interfaceProcessInstanceBuilder
-
overrideProcessDefinitionTenantId
public ProcessInstanceBuilder overrideProcessDefinitionTenantId(String tenantId)
Description copied from interface:ProcessInstanceBuilderIndicator to override the tenant id of the process definition with the provided value. The tenantId to lookup the process definition should still be provided if needed.- Specified by:
overrideProcessDefinitionTenantIdin interfaceProcessInstanceBuilder
-
predefineProcessInstanceId
public ProcessInstanceBuilder predefineProcessInstanceId(String processInstanceId)
Description copied from interface:ProcessInstanceBuilderWhen starting a process instance from the CMMN engine process task, the process instance id needs to be known beforehand to store entity links and callback references before the process instance is started.- Specified by:
predefineProcessInstanceIdin interfaceProcessInstanceBuilder
-
owner
public ProcessInstanceBuilder owner(String userId)
Description copied from interface:ProcessInstanceBuilderSet the owner of the process instance to be created to the given user id.- Specified by:
ownerin interfaceProcessInstanceBuilder- Parameters:
userId- the id of the user to become the owner of the process instance- Returns:
- the process instance builder for method chaining
-
assignee
public ProcessInstanceBuilder assignee(String userId)
Description copied from interface:ProcessInstanceBuilderSet the assignee of the process instance to be created to the given user id.- Specified by:
assigneein interfaceProcessInstanceBuilder- Parameters:
userId- the id of the user to become the owner of the process instance- Returns:
- the process instance builder for method chaining
-
variables
public ProcessInstanceBuilder variables(Map<String,Object> variables)
Description copied from interface:ProcessInstanceBuilderSets the process variables- Specified by:
variablesin interfaceProcessInstanceBuilder
-
variable
public ProcessInstanceBuilder variable(String variableName, Object value)
Description copied from interface:ProcessInstanceBuilderAdds a variable to the process instance- Specified by:
variablein interfaceProcessInstanceBuilder
-
transientVariables
public ProcessInstanceBuilder transientVariables(Map<String,Object> transientVariables)
Description copied from interface:ProcessInstanceBuilderSets the transient variables- Specified by:
transientVariablesin interfaceProcessInstanceBuilder
-
transientVariable
public ProcessInstanceBuilder transientVariable(String variableName, Object value)
Description copied from interface:ProcessInstanceBuilderAdds a transient variable to the process instance- Specified by:
transientVariablein interfaceProcessInstanceBuilder
-
startFormVariables
public ProcessInstanceBuilder startFormVariables(Map<String,Object> startFormVariables)
Description copied from interface:ProcessInstanceBuilderAdds variables from a start form to the process instance.- Specified by:
startFormVariablesin interfaceProcessInstanceBuilder
-
startFormVariable
public ProcessInstanceBuilder startFormVariable(String variableName, Object value)
Description copied from interface:ProcessInstanceBuilderAdds one variable from a start form to the process instance.- Specified by:
startFormVariablein interfaceProcessInstanceBuilder
-
outcome
public ProcessInstanceBuilder outcome(String outcome)
Description copied from interface:ProcessInstanceBuilderAllows to set an outcome for a start form.- Specified by:
outcomein interfaceProcessInstanceBuilder
-
formVariables
public ProcessInstanceBuilder formVariables(Map<String,Object> formVariables, FormInfo formInfo, String formOutcome)
Description copied from interface:ProcessInstanceBuilderStart the process instance with the given form variables from the givenformInfo. This is different thanProcessInstanceBuilder.startFormVariables(Map)and it can be used in addition to that.- Specified by:
formVariablesin interfaceProcessInstanceBuilder
-
fallbackToDefaultTenant
public ProcessInstanceBuilder fallbackToDefaultTenant()
Description copied from interface:ProcessInstanceBuilderUse default tenant as a fallback in the case when process definition was not found by key and tenant id- Specified by:
fallbackToDefaultTenantin interfaceProcessInstanceBuilder
-
start
public ProcessInstance start()
Description copied from interface:ProcessInstanceBuilderStart the process instance- Specified by:
startin interfaceProcessInstanceBuilder
-
startAsync
public ProcessInstance startAsync()
Description copied from interface:ProcessInstanceBuilderStart the process instance asynchronously- Specified by:
startAsyncin interfaceProcessInstanceBuilder
-
getProcessDefinitionId
public String getProcessDefinitionId()
-
getProcessDefinitionKey
public String getProcessDefinitionKey()
-
getProcessDefinitionParentDeploymentId
public String getProcessDefinitionParentDeploymentId()
-
getMessageName
public String getMessageName()
-
getStartEventId
public String getStartEventId()
-
getProcessInstanceName
public String getProcessInstanceName()
-
getBusinessKey
public String getBusinessKey()
-
getBusinessStatus
public String getBusinessStatus()
-
getCallbackId
public String getCallbackId()
-
getCallbackType
public String getCallbackType()
-
getReferenceId
public String getReferenceId()
-
getReferenceType
public String getReferenceType()
-
getStageInstanceId
public String getStageInstanceId()
-
getTenantId
public String getTenantId()
-
getOverrideDefinitionTenantId
public String getOverrideDefinitionTenantId()
-
getPredefinedProcessInstanceId
public String getPredefinedProcessInstanceId()
-
getOwnerId
public String getOwnerId()
-
getAssigneeId
public String getAssigneeId()
-
getOutcome
public String getOutcome()
-
getExtraFormInfo
public FormInfo getExtraFormInfo()
-
getExtraFormOutcome
public String getExtraFormOutcome()
-
isFallbackToDefaultTenant
public boolean isFallbackToDefaultTenant()
-
-