Class CaseInstanceBuilderImpl
- java.lang.Object
 - 
- org.camunda.bpm.engine.impl.cmmn.CaseInstanceBuilderImpl
 
 
- 
- All Implemented Interfaces:
 CaseInstanceBuilder
public class CaseInstanceBuilderImpl extends java.lang.Object implements CaseInstanceBuilder
- Author:
 - Roman Smirnov
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringbusinessKeyprotected java.lang.StringcaseDefinitionIdprotected java.lang.StringcaseDefinitionKeyprotected java.lang.StringcaseDefinitionTenantIdprotected CommandContextcommandContextprotected CommandExecutorcommandExecutorprotected booleanisTenantIdSetprotected VariableMapvariables 
- 
Constructor Summary
Constructors Constructor Description CaseInstanceBuilderImpl(CommandContext commandContext, java.lang.String caseDefinitionKey, java.lang.String caseDefinitionId)CaseInstanceBuilderImpl(CommandExecutor commandExecutor, java.lang.String caseDefinitionKey, java.lang.String caseDefinitionId) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CaseInstanceBuilderbusinessKey(java.lang.String businessKey)A business key can be provided to associate the case instance with a certain identifier that has a clear business meaning.CaseInstanceBuildercaseDefinitionTenantId(java.lang.String tenantId)Specify the id of the tenant the case definition belongs to.CaseInstanceBuildercaseDefinitionWithoutTenantId()Specify that the case definition belongs to no tenant.CaseInstancecreate()Creates a newCaseInstance, which will be in theACTIVEstate.java.lang.StringgetBusinessKey()java.lang.StringgetCaseDefinitionId()java.lang.StringgetCaseDefinitionKey()java.lang.StringgetCaseDefinitionTenantId()VariableMapgetVariables()booleanisTenantIdSet()CaseInstanceBuildersetVariable(java.lang.String variableName, java.lang.Object variableValue)Pass a variable to the case instance.CaseInstanceBuildersetVariables(java.util.Map<java.lang.String,java.lang.Object> variables)Pass a map of variables to the case instance. 
 - 
 
- 
- 
Field Detail
- 
commandExecutor
protected CommandExecutor commandExecutor
 
- 
commandContext
protected CommandContext commandContext
 
- 
caseDefinitionKey
protected java.lang.String caseDefinitionKey
 
- 
caseDefinitionId
protected java.lang.String caseDefinitionId
 
- 
businessKey
protected java.lang.String businessKey
 
- 
variables
protected VariableMap variables
 
- 
caseDefinitionTenantId
protected java.lang.String caseDefinitionTenantId
 
- 
isTenantIdSet
protected boolean isTenantIdSet
 
 - 
 
- 
Constructor Detail
- 
CaseInstanceBuilderImpl
public CaseInstanceBuilderImpl(CommandExecutor commandExecutor, java.lang.String caseDefinitionKey, java.lang.String caseDefinitionId)
 
- 
CaseInstanceBuilderImpl
public CaseInstanceBuilderImpl(CommandContext commandContext, java.lang.String caseDefinitionKey, java.lang.String caseDefinitionId)
 
 - 
 
- 
Method Detail
- 
businessKey
public CaseInstanceBuilder businessKey(java.lang.String businessKey)
Description copied from interface:CaseInstanceBuilderA 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:
 businessKeyin 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(java.lang.String tenantId)
Description copied from interface:CaseInstanceBuilderSpecify the id of the tenant the case definition belongs to. Can only be used when the definition is referenced bykeyand not byid.- Specified by:
 caseDefinitionTenantIdin interfaceCaseInstanceBuilder
 
- 
caseDefinitionWithoutTenantId
public CaseInstanceBuilder caseDefinitionWithoutTenantId()
Description copied from interface:CaseInstanceBuilderSpecify that the case definition belongs to no tenant. Can only be used when the definition is referenced bykeyand not byid.- Specified by:
 caseDefinitionWithoutTenantIdin interfaceCaseInstanceBuilder
 
- 
setVariable
public CaseInstanceBuilder setVariable(java.lang.String variableName, java.lang.Object variableValue)
Description copied from interface:CaseInstanceBuilderPass a variable to the case instance.
Invoking this method multiple times allows passing multiple variables.
- Specified by:
 setVariablein interfaceCaseInstanceBuilder- Parameters:
 variableName- the name of the variable to setvariableValue- the value of the variable to set- Returns:
 - the builder
 
 
- 
setVariables
public CaseInstanceBuilder setVariables(java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from interface:CaseInstanceBuilderPass a map of variables to the case instance.
Invoking this method multiple times allows passing multiple variables.
- Specified by:
 setVariablesin interfaceCaseInstanceBuilder- Parameters:
 variables- the map of variables- Returns:
 - the builder
 
 
- 
create
public CaseInstance create()
Description copied from interface:CaseInstanceBuilderCreates a new
CaseInstance, which will be in theACTIVEstate.- Specified by:
 createin interfaceCaseInstanceBuilder
 
- 
getCaseDefinitionKey
public java.lang.String getCaseDefinitionKey()
 
- 
getCaseDefinitionId
public java.lang.String getCaseDefinitionId()
 
- 
getBusinessKey
public java.lang.String getBusinessKey()
 
- 
getVariables
public VariableMap getVariables()
 
- 
getCaseDefinitionTenantId
public java.lang.String getCaseDefinitionTenantId()
 
- 
isTenantIdSet
public boolean isTenantIdSet()
 
 - 
 
 -