Class CaseInstanceBuilderImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.cmmn.CaseInstanceBuilderImpl
-
- All Implemented Interfaces:
CaseInstanceBuilder
public class CaseInstanceBuilderImpl extends Object implements CaseInstanceBuilder
- Author:
- Roman Smirnov
-
-
Field Summary
Fields Modifier and Type Field Description protected String
businessKey
protected String
caseDefinitionId
protected String
caseDefinitionKey
protected String
caseDefinitionTenantId
protected CommandContext
commandContext
protected CommandExecutor
commandExecutor
protected boolean
isTenantIdSet
protected VariableMap
variables
-
Constructor Summary
Constructors Constructor Description CaseInstanceBuilderImpl(CommandContext commandContext, String caseDefinitionKey, String caseDefinitionId)
CaseInstanceBuilderImpl(CommandExecutor commandExecutor, String caseDefinitionKey, String caseDefinitionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CaseInstanceBuilder
businessKey(String businessKey)
A business key can be provided to associate the case instance with a certain identifier that has a clear business meaning.CaseInstanceBuilder
caseDefinitionTenantId(String tenantId)
Specify the id of the tenant the case definition belongs to.CaseInstanceBuilder
caseDefinitionWithoutTenantId()
Specify that the case definition belongs to no tenant.CaseInstance
create()
Creates a newCaseInstance
, which will be in theACTIVE
state.String
getBusinessKey()
String
getCaseDefinitionId()
String
getCaseDefinitionKey()
String
getCaseDefinitionTenantId()
VariableMap
getVariables()
boolean
isTenantIdSet()
CaseInstanceBuilder
setVariable(String variableName, Object variableValue)
Pass a variable to the case instance.CaseInstanceBuilder
setVariables(Map<String,Object> variables)
Pass a map of variables to the case instance.
-
-
-
Field Detail
-
commandExecutor
protected CommandExecutor commandExecutor
-
commandContext
protected CommandContext commandContext
-
caseDefinitionKey
protected String caseDefinitionKey
-
caseDefinitionId
protected String caseDefinitionId
-
businessKey
protected String businessKey
-
variables
protected VariableMap variables
-
caseDefinitionTenantId
protected String caseDefinitionTenantId
-
isTenantIdSet
protected boolean isTenantIdSet
-
-
Constructor Detail
-
CaseInstanceBuilderImpl
public CaseInstanceBuilderImpl(CommandExecutor commandExecutor, String caseDefinitionKey, String caseDefinitionId)
-
CaseInstanceBuilderImpl
public CaseInstanceBuilderImpl(CommandContext commandContext, String caseDefinitionKey, String caseDefinitionId)
-
-
Method Detail
-
businessKey
public CaseInstanceBuilder businessKey(String businessKey)
Description copied from interface:CaseInstanceBuilder
A business key can be provided to associate the case instance with a certain identifier that has a clear business meaning. This business key can then be used to easily look up that case instance, see
CaseInstanceQuery.caseInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice.Note that a business key MUST be unique for the given case definition WHEN you have added a database constraint for it. In this case, only case instance from different case definition are allowed to have the same business key and the combination of caseDefinitionKey-businessKey must be unique.
- Specified by:
businessKey
in interfaceCaseInstanceBuilder
- Parameters:
businessKey
- a key that uniquely identifies the case instance in the context of the given case definition.- Returns:
- the builder
-
caseDefinitionTenantId
public CaseInstanceBuilder caseDefinitionTenantId(String tenantId)
Description copied from interface:CaseInstanceBuilder
Specify the id of the tenant the case definition belongs to. Can only be used when the definition is referenced bykey
and not byid
.- Specified by:
caseDefinitionTenantId
in interfaceCaseInstanceBuilder
-
caseDefinitionWithoutTenantId
public CaseInstanceBuilder caseDefinitionWithoutTenantId()
Description copied from interface:CaseInstanceBuilder
Specify that the case definition belongs to no tenant. Can only be used when the definition is referenced bykey
and not byid
.- Specified by:
caseDefinitionWithoutTenantId
in interfaceCaseInstanceBuilder
-
setVariable
public CaseInstanceBuilder setVariable(String variableName, Object variableValue)
Description copied from interface:CaseInstanceBuilder
Pass a variable to the case instance.
Invoking this method multiple times allows passing multiple variables.
- Specified by:
setVariable
in interfaceCaseInstanceBuilder
- Parameters:
variableName
- the name of the variable to setvariableValue
- the value of the variable to set- Returns:
- the builder
-
setVariables
public CaseInstanceBuilder setVariables(Map<String,Object> variables)
Description copied from interface:CaseInstanceBuilder
Pass a map of variables to the case instance.
Invoking this method multiple times allows passing multiple variables.
- Specified by:
setVariables
in interfaceCaseInstanceBuilder
- Parameters:
variables
- the map of variables- Returns:
- the builder
-
create
public CaseInstance create()
Description copied from interface:CaseInstanceBuilder
Creates a new
CaseInstance
, which will be in theACTIVE
state.- Specified by:
create
in interfaceCaseInstanceBuilder
-
getCaseDefinitionKey
public String getCaseDefinitionKey()
-
getCaseDefinitionId
public String getCaseDefinitionId()
-
getBusinessKey
public String getBusinessKey()
-
getVariables
public VariableMap getVariables()
-
getCaseDefinitionTenantId
public String getCaseDefinitionTenantId()
-
isTenantIdSet
public boolean isTenantIdSet()
-
-