Class VariableInstanceEntity
- java.lang.Object
-
- org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity
-
- All Implemented Interfaces:
java.io.Serializable,CoreVariableInstance,DbEntity,DbEntityLifecycleAware,HasDbReferences,HasDbRevision,Nameable,TypedValueUpdateListener,ValueFields,VariableInstance
public class VariableInstanceEntity extends java.lang.Object implements VariableInstance, CoreVariableInstance, ValueFields, DbEntity, DbEntityLifecycleAware, TypedValueUpdateListener, HasDbRevision, HasDbReferences, java.io.Serializable
- Author:
- Tom Baeyens
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringactivityInstanceIdprotected java.lang.StringbatchIdprotected ByteArrayFieldbyteArrayFieldprotected java.lang.StringcaseExecutionIdprotected java.lang.StringcaseInstanceIdprotected java.lang.Stringconfigurationprotected java.lang.DoubledoubleValueprotected ExecutionEntityexecutionprotected java.lang.StringexecutionIdprotected java.lang.Stringidprotected booleanisConcurrentLocalDetermines whether this variable is supposed to be a local variable in case of concurrency in its scope.protected booleanisTransientDetermines whether this variable is stored in the data base.protected static EnginePersistenceLoggerLOGprotected java.lang.LonglongValueprotected java.lang.Stringnameprotected java.lang.StringprocessDefinitionIdprotected java.lang.StringprocessInstanceIdprotected intrevisionprotected longsequenceCounterprotected java.lang.StringtaskIdprotected java.lang.StringtenantIdprotected java.lang.StringtextValueprotected java.lang.StringtextValue2protected TypedValueFieldtypedValueFieldprotected java.lang.StringvariableScopeId
-
Constructor Summary
Constructors Constructor Description VariableInstanceEntity()VariableInstanceEntity(java.lang.String name, TypedValue value, boolean isTransient)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearValueFields()static VariableInstanceEntitycreate(java.lang.String name, TypedValue value, boolean isTransient)static VariableInstanceEntitycreateAndInsert(java.lang.String name, TypedValue value)voiddelete()protected voiddeleteByteArrayValue()protected voidensureExecutionInitialized()booleanequals(java.lang.Object obj)java.lang.StringgetActivityInstanceId()Returns the corresponding activity instance id.java.lang.StringgetBatchId()Returns the corresponding batch id.byte[]getByteArrayValue()java.lang.StringgetByteArrayValueId()CaseExecutionEntitygetCaseExecution()java.lang.StringgetCaseExecutionId()Returns the corresponding case execution id.java.lang.StringgetCaseInstanceId()Returns the corresponding case instance id.protected ProcessApplicationReferencegetContextProcessApplication()java.lang.DoublegetDoubleValue()java.lang.StringgetErrorMessage()If the variable value could not be loaded, this returns the error message.ExecutionEntitygetExecution()java.lang.StringgetExecutionId()Returns the corresponding execution id.java.lang.StringgetId()java.lang.LonggetLongValue()java.lang.StringgetName()Returns the name of this variable instance.java.lang.ObjectgetPersistentState()Returns a representation of the object, as would be stored in the database.java.lang.StringgetProcessDefinitionId()Return the corresponding process definition id.java.lang.StringgetProcessInstanceId()Returns the corresponding process instance id.java.util.Map<java.lang.String,java.lang.Class>getReferencedEntitiesIdAndClass()Scope: IN-MEMORY referencesjava.util.Set<java.lang.String>getReferencedEntityIds()Scope: IN-MEMORY referencesintgetRevision()intgetRevisionNext()longgetSequenceCounter()TypedValueSerializer<?>getSerializer()java.lang.StringgetSerializerName()protected TaskEntitygetTask()java.lang.StringgetTaskId()Returns the corresponding task id.java.lang.StringgetTenantId()The id of the tenant this variable belongs to.java.lang.StringgetTextValue()java.lang.StringgetTextValue2()TypedValuegetTypedValue()Returns the TypedValue of this variable instance.TypedValuegetTypedValue(boolean deserializeValue)java.lang.StringgetTypeName()Returns the name of the type of this variable instancejava.lang.ObjectgetValue()Returns the value of this variable instance.protected VariableScopegetVariableScope()java.lang.StringgetVariableScopeId()inthashCode()voidincrementSequenceCounter()static voidinsert(VariableInstanceEntity variableInstance)booleanisConcurrentLocal()booleanisTransient()voidonImplicitValueUpdate(TypedValue updatedValue)Called when an implicit update to a typed value is detectedvoidpostLoad()voidsetActivityInstanceId(java.lang.String activityInstanceId)voidsetBatchId(java.lang.String batchId)voidsetByteArrayValue(byte[] bytes)voidsetByteArrayValueId(java.lang.String byteArrayValueId)voidsetCaseExecution(CaseExecutionEntity caseExecution)voidsetCaseExecutionId(java.lang.String caseExecutionId)voidsetCaseInstanceId(java.lang.String caseInstanceId)voidsetConcurrentLocal(boolean isConcurrentLocal)voidsetDoubleValue(java.lang.Double doubleValue)voidsetExecution(ExecutionEntity execution)voidsetExecutionId(java.lang.String executionId)voidsetId(java.lang.String id)voidsetLongValue(java.lang.Long longValue)voidsetName(java.lang.String name)voidsetProcessDefinitionId(java.lang.String processDefinitionId)voidsetProcessInstanceId(java.lang.String processInstanceId)voidsetRevision(int revision)voidsetSequenceCounter(long sequenceCounter)voidsetSerializer(TypedValueSerializer<?> serializer)voidsetSerializerName(java.lang.String type)voidsetTask(TaskEntity task)voidsetTaskId(java.lang.String taskId)voidsetTenantId(java.lang.String tenantId)voidsetTextValue(java.lang.String textValue)voidsetTextValue2(java.lang.String textValue2)voidsetTransient(boolean isTransient)voidsetValue(TypedValue value)voidsetVariableScopeId(java.lang.String variableScopeId)java.lang.StringtoString()booleanwasCreatedBefore713()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.db.HasDbReferences
getDependentEntities
-
-
-
-
Field Detail
-
LOG
protected static final EnginePersistenceLogger LOG
-
id
protected java.lang.String id
-
revision
protected int revision
-
name
protected java.lang.String name
-
processDefinitionId
protected java.lang.String processDefinitionId
-
processInstanceId
protected java.lang.String processInstanceId
-
executionId
protected java.lang.String executionId
-
taskId
protected java.lang.String taskId
-
batchId
protected java.lang.String batchId
-
caseInstanceId
protected java.lang.String caseInstanceId
-
caseExecutionId
protected java.lang.String caseExecutionId
-
activityInstanceId
protected java.lang.String activityInstanceId
-
tenantId
protected java.lang.String tenantId
-
longValue
protected java.lang.Long longValue
-
doubleValue
protected java.lang.Double doubleValue
-
textValue
protected java.lang.String textValue
-
textValue2
protected java.lang.String textValue2
-
variableScopeId
protected java.lang.String variableScopeId
-
byteArrayField
protected ByteArrayField byteArrayField
-
typedValueField
protected TypedValueField typedValueField
-
configuration
protected java.lang.String configuration
-
sequenceCounter
protected long sequenceCounter
-
isConcurrentLocal
protected boolean isConcurrentLocal
Determines whether this variable is supposed to be a local variable in case of concurrency in its scope. This affects
- tree expansion (not evaluated yet by the engine)
- activity instance IDs of variable instances: concurrentLocal variables always receive the activity instance id of their execution (which may not be the scope execution), while non-concurrentLocal variables always receive the activity instance id of their scope (which is set in the parent execution)
In the future, this field could be used for restoring the variable distribution when the tree is expanded/compacted multiple times. On expansion, the goal would be to keep concurrentLocal variables always with their concurrent replacing executions while non-concurrentLocal variables stay in the scope execution
-
isTransient
protected boolean isTransient
Determines whether this variable is stored in the data base.
-
execution
protected ExecutionEntity execution
-
-
Constructor Detail
-
VariableInstanceEntity
public VariableInstanceEntity()
-
VariableInstanceEntity
public VariableInstanceEntity(java.lang.String name, TypedValue value, boolean isTransient)
-
-
Method Detail
-
createAndInsert
public static VariableInstanceEntity createAndInsert(java.lang.String name, TypedValue value)
-
insert
public static void insert(VariableInstanceEntity variableInstance)
-
create
public static VariableInstanceEntity create(java.lang.String name, TypedValue value, boolean isTransient)
-
delete
public void delete()
-
getPersistentState
public java.lang.Object getPersistentState()
Description copied from interface:DbEntityReturns a representation of the object, as would be stored in the database. Used when deciding if updates have occurred to the object or not since it was last loaded.- Specified by:
getPersistentStatein interfaceDbEntity
-
getRevisionNext
public int getRevisionNext()
- Specified by:
getRevisionNextin interfaceHasDbRevision
-
setProcessInstanceId
public void setProcessInstanceId(java.lang.String processInstanceId)
-
setProcessDefinitionId
public void setProcessDefinitionId(java.lang.String processDefinitionId)
-
setExecutionId
public void setExecutionId(java.lang.String executionId)
-
setCaseInstanceId
public void setCaseInstanceId(java.lang.String caseInstanceId)
-
setCaseExecutionId
public void setCaseExecutionId(java.lang.String caseExecutionId)
-
setCaseExecution
public void setCaseExecution(CaseExecutionEntity caseExecution)
-
getByteArrayValueId
public java.lang.String getByteArrayValueId()
-
setByteArrayValueId
public void setByteArrayValueId(java.lang.String byteArrayValueId)
-
getByteArrayValue
public byte[] getByteArrayValue()
- Specified by:
getByteArrayValuein interfaceValueFields
-
setByteArrayValue
public void setByteArrayValue(byte[] bytes)
- Specified by:
setByteArrayValuein interfaceValueFields
-
deleteByteArrayValue
protected void deleteByteArrayValue()
-
getValue
public java.lang.Object getValue()
Description copied from interface:VariableInstanceReturns the value of this variable instance.- Specified by:
getValuein interfaceVariableInstance
-
getTypedValue
public TypedValue getTypedValue()
Description copied from interface:VariableInstanceReturns the TypedValue of this variable instance.- Specified by:
getTypedValuein interfaceVariableInstance
-
getTypedValue
public TypedValue getTypedValue(boolean deserializeValue)
- Specified by:
getTypedValuein interfaceCoreVariableInstance
-
setValue
public void setValue(TypedValue value)
- Specified by:
setValuein interfaceCoreVariableInstance
-
clearValueFields
public void clearValueFields()
-
getTypeName
public java.lang.String getTypeName()
Description copied from interface:VariableInstanceReturns the name of the type of this variable instance- Specified by:
getTypeNamein interfaceVariableInstance- Returns:
- the type name of the variable
-
postLoad
public void postLoad()
- Specified by:
postLoadin interfaceDbEntityLifecycleAware
-
ensureExecutionInitialized
protected void ensureExecutionInitialized()
-
getExecution
public ExecutionEntity getExecution()
-
setExecution
public void setExecution(ExecutionEntity execution)
-
getCaseExecution
public CaseExecutionEntity getCaseExecution()
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceDbEntity- Specified by:
getIdin interfaceVariableInstance- Returns:
- the Id of this variable instance
-
getTextValue
public java.lang.String getTextValue()
- Specified by:
getTextValuein interfaceValueFields
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
Description copied from interface:VariableInstanceReturns the corresponding process instance id.- Specified by:
getProcessInstanceIdin interfaceVariableInstance
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
Description copied from interface:VariableInstanceReturn the corresponding process definition id.- Specified by:
getProcessDefinitionIdin interfaceVariableInstance
-
getExecutionId
public java.lang.String getExecutionId()
Description copied from interface:VariableInstanceReturns the corresponding execution id.- Specified by:
getExecutionIdin interfaceVariableInstance
-
getCaseInstanceId
public java.lang.String getCaseInstanceId()
Description copied from interface:VariableInstanceReturns the corresponding case instance id.- Specified by:
getCaseInstanceIdin interfaceVariableInstance
-
getCaseExecutionId
public java.lang.String getCaseExecutionId()
Description copied from interface:VariableInstanceReturns the corresponding case execution id.- Specified by:
getCaseExecutionIdin interfaceVariableInstance
-
getLongValue
public java.lang.Long getLongValue()
- Specified by:
getLongValuein interfaceValueFields
-
setLongValue
public void setLongValue(java.lang.Long longValue)
- Specified by:
setLongValuein interfaceValueFields
-
getDoubleValue
public java.lang.Double getDoubleValue()
- Specified by:
getDoubleValuein interfaceValueFields
-
setDoubleValue
public void setDoubleValue(java.lang.Double doubleValue)
- Specified by:
setDoubleValuein interfaceValueFields
-
setName
public void setName(java.lang.String name)
-
setTextValue
public void setTextValue(java.lang.String textValue)
- Specified by:
setTextValuein interfaceValueFields
-
getName
public java.lang.String getName()
Description copied from interface:VariableInstanceReturns the name of this variable instance.- Specified by:
getNamein interfaceCoreVariableInstance- Specified by:
getNamein interfaceNameable- Specified by:
getNamein interfaceVariableInstance
-
getRevision
public int getRevision()
- Specified by:
getRevisionin interfaceHasDbRevision
-
setRevision
public void setRevision(int revision)
- Specified by:
setRevisionin interfaceHasDbRevision
-
setSerializer
public void setSerializer(TypedValueSerializer<?> serializer)
-
setSerializerName
public void setSerializerName(java.lang.String type)
-
getSerializer
public TypedValueSerializer<?> getSerializer()
-
getTextValue2
public java.lang.String getTextValue2()
- Specified by:
getTextValue2in interfaceValueFields
-
setTextValue2
public void setTextValue2(java.lang.String textValue2)
- Specified by:
setTextValue2in interfaceValueFields
-
getTaskId
public java.lang.String getTaskId()
Description copied from interface:VariableInstanceReturns the corresponding task id.- Specified by:
getTaskIdin interfaceVariableInstance
-
setTaskId
public void setTaskId(java.lang.String taskId)
-
getBatchId
public java.lang.String getBatchId()
Description copied from interface:VariableInstanceReturns the corresponding batch id.- Specified by:
getBatchIdin interfaceVariableInstance
-
setBatchId
public void setBatchId(java.lang.String batchId)
-
setTask
public void setTask(TaskEntity task)
-
getActivityInstanceId
public java.lang.String getActivityInstanceId()
Description copied from interface:VariableInstanceReturns the corresponding activity instance id.- Specified by:
getActivityInstanceIdin interfaceVariableInstance
-
setActivityInstanceId
public void setActivityInstanceId(java.lang.String activityInstanceId)
-
getSerializerName
public java.lang.String getSerializerName()
-
getErrorMessage
public java.lang.String getErrorMessage()
Description copied from interface:VariableInstanceIf the variable value could not be loaded, this returns the error message.- Specified by:
getErrorMessagein interfaceVariableInstance- Returns:
- an error message indicating why the variable value could not be loaded.
-
getVariableScopeId
public java.lang.String getVariableScopeId()
-
setVariableScopeId
public void setVariableScopeId(java.lang.String variableScopeId)
-
getVariableScope
protected VariableScope getVariableScope()
-
getTask
protected TaskEntity getTask()
-
getSequenceCounter
public long getSequenceCounter()
-
setSequenceCounter
public void setSequenceCounter(long sequenceCounter)
-
incrementSequenceCounter
public void incrementSequenceCounter()
-
isConcurrentLocal
public boolean isConcurrentLocal()
-
setConcurrentLocal
public void setConcurrentLocal(boolean isConcurrentLocal)
-
onImplicitValueUpdate
public void onImplicitValueUpdate(TypedValue updatedValue)
Description copied from interface:TypedValueUpdateListenerCalled when an implicit update to a typed value is detected- Specified by:
onImplicitValueUpdatein interfaceTypedValueUpdateListener
-
getContextProcessApplication
protected ProcessApplicationReference getContextProcessApplication()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
setTransient
public void setTransient(boolean isTransient)
- Parameters:
isTransient-true, if the variable is not stored in the data base. Default isfalse.
-
isTransient
public boolean isTransient()
- Returns:
true, if the variable is transient. A transient variable is not stored in the data base.
-
getTenantId
public java.lang.String getTenantId()
Description copied from interface:VariableInstanceThe id of the tenant this variable belongs to. Can benullif the variable belongs to no single tenant.- Specified by:
getTenantIdin interfaceVariableInstance
-
setTenantId
public void setTenantId(java.lang.String tenantId)
-
getReferencedEntityIds
public java.util.Set<java.lang.String> getReferencedEntityIds()
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntityIdsin interfaceHasDbReferences- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
public java.util.Map<java.lang.String,java.lang.Class> getReferencedEntitiesIdAndClass()
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClassin interfaceHasDbReferences- Returns:
- a map of the ids and the entities' classes that this entity references. It's used when trying to determine if there was an Optimistic Locking occurrence on an INSERT or UPDATE of an object of this type.
-
wasCreatedBefore713
public boolean wasCreatedBefore713()
- Returns:
trueprocessDefinitionIdis introduced in 7.13, the check is used to created missing history atLegacyBehavior#createMissingHistoricVariables
-
-