Class CaseInstanceBuilderImpl
java.lang.Object
org.flowable.cmmn.engine.impl.runtime.CaseInstanceBuilderImpl
- All Implemented Interfaces:
CaseInstanceBuilder
- Author:
- Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected CmmnRuntimeServiceImpl
protected boolean
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected boolean
protected 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()
boolean
boolean
Saves 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:CaseInstanceBuilder
Set 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:
caseDefinitionId
in 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:CaseInstanceBuilder
Set 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:
caseDefinitionKey
in 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:CaseInstanceBuilder
When 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:
caseDefinitionParentDeploymentId
in interfaceCaseInstanceBuilder
-
predefinedCaseInstanceId
Description copied from interface:CaseInstanceBuilder
If 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:
predefinedCaseInstanceId
in interfaceCaseInstanceBuilder
- Parameters:
caseInstanceId
- the id of the new case instance to be used- Returns:
- the case instance builder for method chaining
-
name
- Specified by:
name
in interfaceCaseInstanceBuilder
-
businessKey
- Specified by:
businessKey
in interfaceCaseInstanceBuilder
-
businessStatus
- Specified by:
businessStatus
in interfaceCaseInstanceBuilder
-
variables
- Specified by:
variables
in interfaceCaseInstanceBuilder
-
variable
- Specified by:
variable
in interfaceCaseInstanceBuilder
-
transientVariables
- Specified by:
transientVariables
in interfaceCaseInstanceBuilder
-
transientVariable
- Specified by:
transientVariable
in interfaceCaseInstanceBuilder
-
tenantId
- Specified by:
tenantId
in interfaceCaseInstanceBuilder
-
owner
Description copied from interface:CaseInstanceBuilder
Set the owner of the case to be created to the given user id.- Specified by:
owner
in 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:CaseInstanceBuilder
Set the assignee of the case to be created to the given user id.- Specified by:
assignee
in 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:CaseInstanceBuilder
Indicator 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:
overrideCaseDefinitionTenantId
in interfaceCaseInstanceBuilder
-
outcome
Description copied from interface:CaseInstanceBuilder
Saves 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:
outcome
in interfaceCaseInstanceBuilder
- Parameters:
outcome
- the outcome to be registered in the builder- Returns:
- the case instance builder for method chaining
-
startFormVariables
Description copied from interface:CaseInstanceBuilder
Allows 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:
startFormVariables
in interfaceCaseInstanceBuilder
-
callbackId
Description copied from interface:CaseInstanceBuilder
Set callback id of the newly created case instance.- Specified by:
callbackId
in interfaceCaseInstanceBuilder
- Parameters:
callbackId
- id of the callback- Returns:
- case instance builder which creates case instance with defined callback id
-
callbackType
Description copied from interface:CaseInstanceBuilder
Set callback type of the newly created case instance.- Specified by:
callbackType
in interfaceCaseInstanceBuilder
- Parameters:
callbackType
- type of the callback- Returns:
- case instance builder which creates case instance with defined callback type
-
referenceId
Description copied from interface:CaseInstanceBuilder
Set the reference id on the newly create case instance.- Specified by:
referenceId
in interfaceCaseInstanceBuilder
-
referenceType
Description copied from interface:CaseInstanceBuilder
Set the reference type on the newly create case instance.- Specified by:
referenceType
in interfaceCaseInstanceBuilder
-
parentId
Description copied from interface:CaseInstanceBuilder
Set parent case instanceId of the newly create case instance- Specified by:
parentId
in 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:CaseInstanceBuilder
If case definition is not found by key in the specified tenant use default tenant search as a fallback- Specified by:
fallbackToDefaultTenant
in interfaceCaseInstanceBuilder
- Returns:
- modified case instance builder
-
start
Description copied from interface:CaseInstanceBuilder
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. 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:
start
in interfaceCaseInstanceBuilder
- Returns:
- the case instance
-
startAsync
Description copied from interface:CaseInstanceBuilder
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.- Specified by:
startAsync
in interfaceCaseInstanceBuilder
- Returns:
- the case instance as being persisted, but not yet evaluated through the case model
-
startWithForm
Description copied from interface:CaseInstanceBuilder
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. validation).- Specified by:
startWithForm
in interfaceCaseInstanceBuilder
- Returns:
- the case instance as being persisted, but not yet evaluated through the case model
-
getCaseDefinitionId
- Specified by:
getCaseDefinitionId
in interfaceCaseInstanceBuilder
-
getCaseDefinitionKey
- Specified by:
getCaseDefinitionKey
in interfaceCaseInstanceBuilder
-
getCaseDefinitionParentDeploymentId
- Specified by:
getCaseDefinitionParentDeploymentId
in interfaceCaseInstanceBuilder
-
getPredefinedCaseInstanceId
- Specified by:
getPredefinedCaseInstanceId
in interfaceCaseInstanceBuilder
-
getName
- Specified by:
getName
in interfaceCaseInstanceBuilder
-
getBusinessKey
- Specified by:
getBusinessKey
in interfaceCaseInstanceBuilder
-
getBusinessStatus
- Specified by:
getBusinessStatus
in interfaceCaseInstanceBuilder
-
getVariables
- Specified by:
getVariables
in interfaceCaseInstanceBuilder
-
getTransientVariables
- Specified by:
getTransientVariables
in interfaceCaseInstanceBuilder
-
getTenantId
- Specified by:
getTenantId
in interfaceCaseInstanceBuilder
-
getOwner
- Specified by:
getOwner
in interfaceCaseInstanceBuilder
-
getAssignee
- Specified by:
getAssignee
in interfaceCaseInstanceBuilder
-
getOverrideDefinitionTenantId
- Specified by:
getOverrideDefinitionTenantId
in interfaceCaseInstanceBuilder
-
getOutcome
- Specified by:
getOutcome
in interfaceCaseInstanceBuilder
-
getStartFormVariables
- Specified by:
getStartFormVariables
in interfaceCaseInstanceBuilder
-
getCallbackId
- Specified by:
getCallbackId
in interfaceCaseInstanceBuilder
-
getCallbackType
- Specified by:
getCallbackType
in interfaceCaseInstanceBuilder
-
getReferenceId
- Specified by:
getReferenceId
in interfaceCaseInstanceBuilder
-
getReferenceType
- Specified by:
getReferenceType
in interfaceCaseInstanceBuilder
-
getParentId
- Specified by:
getParentId
in interfaceCaseInstanceBuilder
-
isFallbackToDefaultTenant
public boolean isFallbackToDefaultTenant()- Specified by:
isFallbackToDefaultTenant
in interfaceCaseInstanceBuilder
-
isStartWithForm
public boolean isStartWithForm()- Specified by:
isStartWithForm
in interfaceCaseInstanceBuilder
-