Class CaseInstanceBuilderImpl
java.lang.Object
org.flowable.cmmn.engine.impl.runtime.CaseInstanceBuilderImpl
- All Implemented Interfaces:
CaseInstanceBuilder
- Author:
- Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected CmmnRuntimeServiceImplprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the assignee of the case to be created to the given user id.businessKey(String businessKey) businessStatus(String businessStatus) callbackId(String callbackId) Set callback id of the newly created case instance.callbackType(String callbackType) Set callback type of the newly created case instance.caseDefinitionId(String caseDefinitionId) Set the case definition to be used for creating a new case instance by its id.caseDefinitionKey(String caseDefinitionKey) Set the case definition to be used for creating a new case instance by its key.caseDefinitionParentDeploymentId(String parentDeploymentId) When looking up for a case definition by key it would first lookup for a case definition within the given parent deployment.If case definition is not found by key in the specified tenant use default tenant search as a fallbackgetName()getOwner()booleanbooleanSaves the outcome of the start form for the case, if this case should be started out of a start form.overrideCaseDefinitionTenantId(String tenantId) Indicator to override the tenant id of the case definition with the provided value.Set the owner of the case to be created to the given user id.Set parent case instanceId of the newly create case instancepredefinedCaseInstanceId(String caseInstanceId) If the new case instance should have a predefined id, you can set it using this method.referenceId(String referenceId) Set the reference id on the newly create case instance.referenceType(String referenceType) Set the reference type on the newly create case instance.start()Once all the information is set using this builder API, the start method will create the case instance, initialize it according all the data in the builder and then evaluate the case model to start the case.Once all the information is set using this builder API, the startAsync method will create the case instance and initialize its data, but the case model is not yet evaluated, but will be started and evaluated asynchronously in a different transaction.startFormVariables(Map<String, Object> formVariables) Allows to pass any variables if they come from a form.Once all the information is set using this builder API, the startWithForm method will create the case instance and initialize its data by additionally using the submitted form variables and handling them with the start form provided with the case model (e.g.transientVariable(String variableName, Object value) transientVariables(Map<String, Object> transientVariables)
-
Field Details
-
cmmnRuntimeService
-
caseDefinitionId
-
caseDefinitionKey
-
caseDefinitionParentDeploymentId
-
predefinedCaseInstanceId
-
name
-
businessKey
-
businessStatus
-
variables
-
transientVariables
-
tenantId
-
ownerId
-
assigneeId
-
overrideDefinitionTenantId
-
outcome
-
startFormVariables
-
callbackType
-
callbackId
-
referenceId
-
referenceType
-
parentId
-
fallbackToDefaultTenant
protected boolean fallbackToDefaultTenant -
startWithForm
protected boolean startWithForm
-
-
Constructor Details
-
CaseInstanceBuilderImpl
public CaseInstanceBuilderImpl() -
CaseInstanceBuilderImpl
-
-
Method Details
-
caseDefinitionId
Description copied from interface:CaseInstanceBuilderSet the case definition to be used for creating a new case instance by its id. If both the case definition id and the key are set, the id takes precedence and the key will be ignored. At least one of them needs to be specified within the builder.- Specified by:
caseDefinitionIdin interfaceCaseInstanceBuilder- Parameters:
caseDefinitionId- the id of the case definition the new case should be based on- Returns:
- the case instance builder for method chaining
-
caseDefinitionKey
Description copied from interface:CaseInstanceBuilderSet the case definition to be used for creating a new case instance by its key. If both the case definition id and the key are set, the id takes precedence and the key will be ignored. At least one of them needs to be specified within the builder.- Specified by:
caseDefinitionKeyin interfaceCaseInstanceBuilder- Parameters:
caseDefinitionKey- the key of the case definition the new case should be based on- Returns:
- the case instance builder for method chaining
-
caseDefinitionParentDeploymentId
Description copied from interface:CaseInstanceBuilderWhen looking up for a case definition by key it would first lookup for a case definition within the given parent deployment. Then it would fallback to the latest case definition with the given key.This is typically needed when the CaseInstanceBuilder is called for example from the process engine to start a case instance and it needs to lookup the case definition in the same deployment as the process. Or when starting a case via a case task from the cmmn engine
- Specified by:
caseDefinitionParentDeploymentIdin interfaceCaseInstanceBuilder
-
predefinedCaseInstanceId
Description copied from interface:CaseInstanceBuilderIf the new case instance should have a predefined id, you can set it using this method. If that predefined id is set, it will be used instead of creating a new one automatically.- Specified by:
predefinedCaseInstanceIdin interfaceCaseInstanceBuilder- Parameters:
caseInstanceId- the id of the new case instance to be used- Returns:
- the case instance builder for method chaining
-
name
- Specified by:
namein interfaceCaseInstanceBuilder
-
businessKey
- Specified by:
businessKeyin interfaceCaseInstanceBuilder
-
businessStatus
- Specified by:
businessStatusin interfaceCaseInstanceBuilder
-
variables
- Specified by:
variablesin interfaceCaseInstanceBuilder
-
variable
- Specified by:
variablein interfaceCaseInstanceBuilder
-
transientVariables
- Specified by:
transientVariablesin interfaceCaseInstanceBuilder
-
transientVariable
- Specified by:
transientVariablein interfaceCaseInstanceBuilder
-
tenantId
- Specified by:
tenantIdin interfaceCaseInstanceBuilder
-
owner
Description copied from interface:CaseInstanceBuilderSet the owner of the case to be created to the given user id.- Specified by:
ownerin interfaceCaseInstanceBuilder- Parameters:
userId- the id of the user to become the owner of the case- Returns:
- the case instance builder for method chaining
-
assignee
Description copied from interface:CaseInstanceBuilderSet the assignee of the case to be created to the given user id.- Specified by:
assigneein interfaceCaseInstanceBuilder- Parameters:
userId- the id of the user to become the assignee of the case- Returns:
- the case instance builder for method chaining
-
overrideCaseDefinitionTenantId
Description copied from interface:CaseInstanceBuilderIndicator to override the tenant id of the case definition with the provided value. The tenantId to lookup the case definition should still be provided if needed.- Specified by:
overrideCaseDefinitionTenantIdin interfaceCaseInstanceBuilder
-
outcome
Description copied from interface:CaseInstanceBuilderSaves the outcome of the start form for the case, if this case should be started out of a start form. You can additionally save any form variables along with the outcome and start the case usingCaseInstanceBuilder.startWithForm().- Specified by:
outcomein interfaceCaseInstanceBuilder- Parameters:
outcome- the outcome to be registered in the builder- Returns:
- the case instance builder for method chaining
-
startFormVariables
Description copied from interface:CaseInstanceBuilderAllows to pass any variables if they come from a form. The difference with regularCaseInstanceBuilder.variables(Map)is that the start form will be fetched and the variables matched with theFormInfo.- Specified by:
startFormVariablesin interfaceCaseInstanceBuilder
-
callbackId
Description copied from interface:CaseInstanceBuilderSet callback id of the newly created case instance.- Specified by:
callbackIdin interfaceCaseInstanceBuilder- Parameters:
callbackId- id of the callback- Returns:
- case instance builder which creates case instance with defined callback id
-
callbackType
Description copied from interface:CaseInstanceBuilderSet callback type of the newly created case instance.- Specified by:
callbackTypein interfaceCaseInstanceBuilder- Parameters:
callbackType- type of the callback- Returns:
- case instance builder which creates case instance with defined callback type
-
referenceId
Description copied from interface:CaseInstanceBuilderSet the reference id on the newly create case instance.- Specified by:
referenceIdin interfaceCaseInstanceBuilder
-
referenceType
Description copied from interface:CaseInstanceBuilderSet the reference type on the newly create case instance.- Specified by:
referenceTypein interfaceCaseInstanceBuilder
-
parentId
Description copied from interface:CaseInstanceBuilderSet parent case instanceId of the newly create case instance- Specified by:
parentIdin interfaceCaseInstanceBuilder- Parameters:
parentCaseInstanceId- parent case instance identifier- Returns:
- modified case instance builder which creates case instance with the reference to parent
-
fallbackToDefaultTenant
Description copied from interface:CaseInstanceBuilderIf case definition is not found by key in the specified tenant use default tenant search as a fallback- Specified by:
fallbackToDefaultTenantin interfaceCaseInstanceBuilder- Returns:
- modified case instance builder
-
start
Description copied from interface:CaseInstanceBuilderOnce all the information is set using this builder API, the start method will create the case instance, initialize it according all the data in the builder and then evaluate the case model to start the case. It will be initialized, evaluated and started in a single transaction, synchronously, so this method returns once the case model will hit a wait state.- Specified by:
startin interfaceCaseInstanceBuilder- Returns:
- the case instance
-
startAsync
Description copied from interface:CaseInstanceBuilderOnce all the information is set using this builder API, the startAsync method will create the case instance and initialize its data, but the case model is not yet evaluated, but will be started and evaluated asynchronously in a different transaction.- Specified by:
startAsyncin interfaceCaseInstanceBuilder- Returns:
- the case instance as being persisted, but not yet evaluated through the case model
-
startWithForm
Description copied from interface:CaseInstanceBuilderOnce all the information is set using this builder API, the startWithForm method will create the case instance and initialize its data by additionally using the submitted form variables and handling them with the start form provided with the case model (e.g. validation).- Specified by:
startWithFormin interfaceCaseInstanceBuilder- Returns:
- the case instance as being persisted, but not yet evaluated through the case model
-
getCaseDefinitionId
- Specified by:
getCaseDefinitionIdin interfaceCaseInstanceBuilder
-
getCaseDefinitionKey
- Specified by:
getCaseDefinitionKeyin interfaceCaseInstanceBuilder
-
getCaseDefinitionParentDeploymentId
- Specified by:
getCaseDefinitionParentDeploymentIdin interfaceCaseInstanceBuilder
-
getPredefinedCaseInstanceId
- Specified by:
getPredefinedCaseInstanceIdin interfaceCaseInstanceBuilder
-
getName
- Specified by:
getNamein interfaceCaseInstanceBuilder
-
getBusinessKey
- Specified by:
getBusinessKeyin interfaceCaseInstanceBuilder
-
getBusinessStatus
- Specified by:
getBusinessStatusin interfaceCaseInstanceBuilder
-
getVariables
- Specified by:
getVariablesin interfaceCaseInstanceBuilder
-
getTransientVariables
- Specified by:
getTransientVariablesin interfaceCaseInstanceBuilder
-
getTenantId
- Specified by:
getTenantIdin interfaceCaseInstanceBuilder
-
getOwner
- Specified by:
getOwnerin interfaceCaseInstanceBuilder
-
getAssignee
- Specified by:
getAssigneein interfaceCaseInstanceBuilder
-
getOverrideDefinitionTenantId
- Specified by:
getOverrideDefinitionTenantIdin interfaceCaseInstanceBuilder
-
getOutcome
- Specified by:
getOutcomein interfaceCaseInstanceBuilder
-
getStartFormVariables
- Specified by:
getStartFormVariablesin interfaceCaseInstanceBuilder
-
getCallbackId
- Specified by:
getCallbackIdin interfaceCaseInstanceBuilder
-
getCallbackType
- Specified by:
getCallbackTypein interfaceCaseInstanceBuilder
-
getReferenceId
- Specified by:
getReferenceIdin interfaceCaseInstanceBuilder
-
getReferenceType
- Specified by:
getReferenceTypein interfaceCaseInstanceBuilder
-
getParentId
- Specified by:
getParentIdin interfaceCaseInstanceBuilder
-
isFallbackToDefaultTenant
public boolean isFallbackToDefaultTenant()- Specified by:
isFallbackToDefaultTenantin interfaceCaseInstanceBuilder
-
isStartWithForm
public boolean isStartWithForm()- Specified by:
isStartWithFormin interfaceCaseInstanceBuilder
-