public class CaseInstanceBuilderImpl extends Object implements CaseInstanceBuilder
Modifier and Type | Field and Description |
---|---|
protected String |
businessKey |
protected String |
caseDefinitionId |
protected String |
caseDefinitionKey |
protected String |
caseDefinitionTenantId |
protected CommandContext |
commandContext |
protected CommandExecutor |
commandExecutor |
protected boolean |
isTenantIdSet |
protected org.camunda.bpm.engine.variable.VariableMap |
variables |
Constructor and Description |
---|
CaseInstanceBuilderImpl(CommandContext commandContext,
String caseDefinitionKey,
String caseDefinitionId) |
CaseInstanceBuilderImpl(CommandExecutor commandExecutor,
String caseDefinitionKey,
String caseDefinitionId) |
Modifier and Type | Method and 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 new
CaseInstance , which will be in the ACTIVE state. |
String |
getBusinessKey() |
String |
getCaseDefinitionId() |
String |
getCaseDefinitionKey() |
String |
getCaseDefinitionTenantId() |
org.camunda.bpm.engine.variable.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.
|
protected CommandExecutor commandExecutor
protected CommandContext commandContext
protected String caseDefinitionKey
protected String caseDefinitionId
protected String businessKey
protected org.camunda.bpm.engine.variable.VariableMap variables
protected String caseDefinitionTenantId
protected boolean isTenantIdSet
public CaseInstanceBuilderImpl(CommandExecutor commandExecutor, String caseDefinitionKey, String caseDefinitionId)
public CaseInstanceBuilderImpl(CommandContext commandContext, String caseDefinitionKey, String caseDefinitionId)
public CaseInstanceBuilder businessKey(String businessKey)
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.
businessKey
in interface CaseInstanceBuilder
businessKey
- a key that uniquely identifies the case instance in the context
of the given case definition.public CaseInstanceBuilder caseDefinitionTenantId(String tenantId)
CaseInstanceBuilder
key
and not by id
.caseDefinitionTenantId
in interface CaseInstanceBuilder
public CaseInstanceBuilder caseDefinitionWithoutTenantId()
CaseInstanceBuilder
key
and not by id
.caseDefinitionWithoutTenantId
in interface CaseInstanceBuilder
public CaseInstanceBuilder setVariable(String variableName, Object variableValue)
CaseInstanceBuilder
Pass a variable to the case instance.
Invoking this method multiple times allows passing multiple variables.
setVariable
in interface CaseInstanceBuilder
variableName
- the name of the variable to setvariableValue
- the value of the variable to setpublic CaseInstanceBuilder setVariables(Map<String,Object> variables)
CaseInstanceBuilder
Pass a map of variables to the case instance.
Invoking this method multiple times allows passing multiple variables.
setVariables
in interface CaseInstanceBuilder
variables
- the map of variablespublic CaseInstance create()
CaseInstanceBuilder
Creates a new CaseInstance
, which will be in the ACTIVE
state.
create
in interface CaseInstanceBuilder
public String getCaseDefinitionKey()
public String getCaseDefinitionId()
public String getBusinessKey()
public org.camunda.bpm.engine.variable.VariableMap getVariables()
public String getCaseDefinitionTenantId()
public boolean isTenantIdSet()
Copyright © 2022. All rights reserved.