Package org.flowable.cmmn.api.runtime
Interface CaseInstanceBuilder
public interface CaseInstanceBuilder
- Author:
- Joram Barrez, Tijs Rademakers, Micha Kiener
-
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. validation).transientVariable
(String variableName, Object value) transientVariables
(Map<String, Object> transientVariables)
-
Method Details
-
caseDefinitionId
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.- Parameters:
caseDefinitionId
- the id of the case definition the new case should be based on- Returns:
- the case instance builder for method chaining
-
caseDefinitionKey
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.- Parameters:
caseDefinitionKey
- the key of the case definition the new case should be based on- Returns:
- the case instance builder for method chaining
-
caseDefinitionParentDeploymentId
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
-
predefinedCaseInstanceId
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.- Parameters:
caseInstanceId
- the id of the new case instance to be used- Returns:
- the case instance builder for method chaining
-
name
-
businessKey
-
businessStatus
-
variables
-
variable
-
transientVariables
-
transientVariable
-
tenantId
-
owner
Set the owner of the case to be created to the given user id.- Parameters:
userId
- the id of the user to become the owner of the case- Returns:
- the case instance builder for method chaining
-
assignee
Set the assignee of the case to be created to the given user id.- Parameters:
userId
- the id of the user to become the assignee of the case- Returns:
- the case instance builder for method chaining
-
overrideCaseDefinitionTenantId
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. -
startFormVariables
Allows to pass any variables if they come from a form. The difference with regularvariables(Map)
is that the start form will be fetched and the variables matched with theFormInfo
. -
outcome
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 usingstartWithForm()
.- Parameters:
outcome
- the outcome to be registered in the builder- Returns:
- the case instance builder for method chaining
-
callbackId
Set callback id of the newly created case instance.- Parameters:
callbackId
- id of the callback- Returns:
- case instance builder which creates case instance with defined callback id
-
callbackType
Set callback type of the newly created case instance.- Parameters:
callbackType
- type of the callback- Returns:
- case instance builder which creates case instance with defined callback type
-
referenceId
Set the reference id on the newly create case instance. -
referenceType
Set the reference type on the newly create case instance. -
parentId
Set parent case instanceId of the newly create case instance- Parameters:
parentCaseInstanceId
- parent case instance identifier- Returns:
- modified case instance builder which creates case instance with the reference to parent
-
fallbackToDefaultTenant
CaseInstanceBuilder fallbackToDefaultTenant()If case definition is not found by key in the specified tenant use default tenant search as a fallback- Returns:
- modified case instance builder
-
start
CaseInstance 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. 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.- Returns:
- the case instance
-
startAsync
CaseInstance startAsync()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.- Returns:
- the case instance as being persisted, but not yet evaluated through the case model
-
startWithForm
CaseInstance startWithForm()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).- Returns:
- the case instance as being persisted, but not yet evaluated through the case model
-
getCaseDefinitionId
String getCaseDefinitionId() -
getCaseDefinitionKey
String getCaseDefinitionKey() -
getCaseDefinitionParentDeploymentId
String getCaseDefinitionParentDeploymentId() -
getPredefinedCaseInstanceId
String getPredefinedCaseInstanceId() -
getName
String getName() -
getBusinessKey
String getBusinessKey() -
getBusinessStatus
String getBusinessStatus() -
getVariables
-
getTransientVariables
-
getTenantId
String getTenantId() -
getOwner
String getOwner() -
getAssignee
String getAssignee() -
getOverrideDefinitionTenantId
String getOverrideDefinitionTenantId() -
getStartFormVariables
-
getOutcome
String getOutcome() -
getCallbackId
String getCallbackId() -
getCallbackType
String getCallbackType() -
getReferenceId
String getReferenceId() -
getReferenceType
String getReferenceType() -
getParentId
String getParentId() -
isFallbackToDefaultTenant
boolean isFallbackToDefaultTenant() -
isStartWithForm
boolean isStartWithForm()
-