public class CaseInstanceBuilderImpl extends Object implements CaseInstanceBuilder
Modifier and Type | Field and Description |
---|---|
protected String |
businessKey |
protected String |
caseDefinitionId |
protected String |
caseDefinitionKey |
protected CommandContext |
commandContext |
protected CommandExecutor |
commandExecutor |
protected 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.
|
CaseInstance |
create()
Creates a new
CaseInstance , which will be in the ACTIVE state. |
String |
getBusinessKey() |
String |
getCaseDefinitionId() |
String |
getCaseDefinitionKey() |
VariableMap |
getVariables() |
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 VariableMap variables
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 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 VariableMap getVariables()
Copyright © 2018. All rights reserved.