org.camunda.bpm.engine.impl.persistence.entity
Class VariableScopeImpl

java.lang.Object
  extended by org.camunda.bpm.engine.impl.persistence.entity.VariableScopeImpl
All Implemented Interfaces:
Serializable, VariableScope
Direct Known Subclasses:
ExecutionEntity, TaskEntity

public abstract class VariableScopeImpl
extends Object
implements Serializable, VariableScope

Author:
Tom Baeyens, Joram Barrez
See Also:
Serialized Form

Field Summary
protected  ELContext cachedElContext
           
protected  String id
           
protected  Map<String,VariableInstanceEntity> variableInstances
           
 
Constructor Summary
VariableScopeImpl()
           
 
Method Summary
protected  void clearVariable(VariableInstanceEntity variableInstance, Object newValue)
           
protected  Set<String> collectVariableNames(Set<String> variableNames)
           
protected  Map<String,Object> collectVariables(HashMap<String,Object> variables)
           
protected  VariableInstanceEntity createVariableInstance(String variableName, Object value, VariableScope sourceActivityExecution)
           
protected  void createVariableLocal(String variableName, Object value)
           
protected  void createVariableLocal(String variableName, Object value, VariableScope sourceActivityExecution)
          only called when a new variable is created on this variable scope.
protected  void createVariablesLocal(Map<String,? extends Object> variables)
           
protected  void deleteVariableInstanceForExplicitUserCall(VariableInstanceEntity variableInstance, VariableScope sourceActivityExecution)
           
 void deleteVariablesInstanceForLeavingScope()
           
protected  void ensureVariableInstancesInitialized()
           
protected  void fireHistoricVariableInstanceCreate(VariableInstanceEntity variableInstance, VariableScope sourceActivityExecution)
           
protected  void fireHistoricVariableInstanceDelete(VariableInstanceEntity variableInstance, VariableScope sourceActivityExecution)
           
protected  void fireHistoricVariableInstanceUpdate(VariableInstanceEntity variableInstance, VariableScope sourceActivityExecution)
           
 ELContext getCachedElContext()
           
 String getId()
           
protected  VariableType getNewVariableType(Object newValue)
           
protected abstract  VariableScopeImpl getParentVariableScope()
           
protected  VariableScope getSourceActivityVariableScope()
           
 Object getVariable(String variableName)
           
 Object getVariableLocal(String variableName)
           
 Set<String> getVariableNames()
           
 Set<String> getVariableNamesLocal()
           
 Map<String,Object> getVariables()
           
 Map<String,Object> getVariablesLocal()
           
 boolean hasVariable(String variableName)
           
 boolean hasVariableLocal(String variableName)
           
 boolean hasVariables()
           
 boolean hasVariablesLocal()
           
protected abstract  void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)
           
protected  boolean isAutoFireHistoryEvents()
           
protected abstract  List<VariableInstanceEntity> loadVariableInstances()
           
 void removeVariable(String variableName)
          Removes the variable and creates a new HistoricVariableUpdateEntity.
protected  void removeVariable(String variableName, VariableScope sourceActivityExecution)
           
 void removeVariableLocal(String variableName)
          Removes the local variable and creates a new HistoricVariableUpdateEntity.
protected  void removeVariableLocal(String variableName, VariableScope sourceActivityExecution)
           
 void removeVariables()
          Removes the (local) variables and creates a new HistoricVariableUpdateEntity for each of them.
 void removeVariables(Collection<String> variableNames)
          Removes the variables and creates a new HistoricVariableUpdateEntity for each of them.
 void removeVariablesLocal()
          Removes the (local) variables and creates a new HistoricVariableUpdateEntity for each of them.
 void removeVariablesLocal(Collection<String> variableNames)
          Removes the local variables and creates a new HistoricVariableUpdateEntity for each of them.
 void setCachedElContext(ELContext cachedElContext)
           
 void setId(String id)
           
 void setVariable(String variableName, Object value)
           
protected  void setVariable(String variableName, Object value, VariableScope sourceActivityExecution)
           
 void setVariableLocal(String variableName, Object value)
           
protected  void setVariableLocal(String variableName, Object value, VariableScope sourceActivityExecution)
           
 void setVariables(Map<String,? extends Object> variables)
           
 void setVariablesLocal(Map<String,? extends Object> variables)
           
protected  void updateVariableInstance(VariableInstanceEntity variableInstance, Object value, VariableScope sourceActivityExecution)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

variableInstances

protected Map<String,VariableInstanceEntity> variableInstances

cachedElContext

protected ELContext cachedElContext

id

protected String id
Constructor Detail

VariableScopeImpl

public VariableScopeImpl()
Method Detail

loadVariableInstances

protected abstract List<VariableInstanceEntity> loadVariableInstances()

getParentVariableScope

protected abstract VariableScopeImpl getParentVariableScope()

initializeVariableInstanceBackPointer

protected abstract void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)

ensureVariableInstancesInitialized

protected void ensureVariableInstancesInitialized()

getVariables

public Map<String,Object> getVariables()
Specified by:
getVariables in interface VariableScope

collectVariables

protected Map<String,Object> collectVariables(HashMap<String,Object> variables)

getVariable

public Object getVariable(String variableName)
Specified by:
getVariable in interface VariableScope

getVariableLocal

public Object getVariableLocal(String variableName)
Specified by:
getVariableLocal in interface VariableScope

hasVariables

public boolean hasVariables()
Specified by:
hasVariables in interface VariableScope

hasVariablesLocal

public boolean hasVariablesLocal()
Specified by:
hasVariablesLocal in interface VariableScope

hasVariable

public boolean hasVariable(String variableName)
Specified by:
hasVariable in interface VariableScope

hasVariableLocal

public boolean hasVariableLocal(String variableName)
Specified by:
hasVariableLocal in interface VariableScope

collectVariableNames

protected Set<String> collectVariableNames(Set<String> variableNames)

getVariableNames

public Set<String> getVariableNames()
Specified by:
getVariableNames in interface VariableScope

getVariablesLocal

public Map<String,Object> getVariablesLocal()
Specified by:
getVariablesLocal in interface VariableScope

getVariableNamesLocal

public Set<String> getVariableNamesLocal()
Specified by:
getVariableNamesLocal in interface VariableScope

createVariablesLocal

protected void createVariablesLocal(Map<String,? extends Object> variables)

setVariables

public void setVariables(Map<String,? extends Object> variables)
Specified by:
setVariables in interface VariableScope

setVariablesLocal

public void setVariablesLocal(Map<String,? extends Object> variables)
Specified by:
setVariablesLocal in interface VariableScope

removeVariables

public void removeVariables()
Description copied from interface: VariableScope
Removes the (local) variables and creates a new HistoricVariableUpdateEntity for each of them.

Specified by:
removeVariables in interface VariableScope

removeVariablesLocal

public void removeVariablesLocal()
Description copied from interface: VariableScope
Removes the (local) variables and creates a new HistoricVariableUpdateEntity for each of them.

Specified by:
removeVariablesLocal in interface VariableScope

deleteVariablesInstanceForLeavingScope

public void deleteVariablesInstanceForLeavingScope()

removeVariables

public void removeVariables(Collection<String> variableNames)
Description copied from interface: VariableScope
Removes the variables and creates a new HistoricVariableUpdateEntity for each of them.

Specified by:
removeVariables in interface VariableScope

removeVariablesLocal

public void removeVariablesLocal(Collection<String> variableNames)
Description copied from interface: VariableScope
Removes the local variables and creates a new HistoricVariableUpdateEntity for each of them.

Specified by:
removeVariablesLocal in interface VariableScope

setVariable

public void setVariable(String variableName,
                        Object value)
Specified by:
setVariable in interface VariableScope

setVariable

protected void setVariable(String variableName,
                           Object value,
                           VariableScope sourceActivityExecution)

setVariableLocal

public void setVariableLocal(String variableName,
                             Object value)
Specified by:
setVariableLocal in interface VariableScope

setVariableLocal

protected void setVariableLocal(String variableName,
                                Object value,
                                VariableScope sourceActivityExecution)

clearVariable

protected void clearVariable(VariableInstanceEntity variableInstance,
                             Object newValue)

getNewVariableType

protected VariableType getNewVariableType(Object newValue)

createVariableLocal

protected void createVariableLocal(String variableName,
                                   Object value)

createVariableLocal

protected void createVariableLocal(String variableName,
                                   Object value,
                                   VariableScope sourceActivityExecution)
only called when a new variable is created on this variable scope. This method is also responsible for propagating the creation of this variable to the history.


removeVariable

public void removeVariable(String variableName)
Description copied from interface: VariableScope
Removes the variable and creates a new HistoricVariableUpdateEntity.

Specified by:
removeVariable in interface VariableScope

removeVariable

protected void removeVariable(String variableName,
                              VariableScope sourceActivityExecution)

removeVariableLocal

public void removeVariableLocal(String variableName)
Description copied from interface: VariableScope
Removes the local variable and creates a new HistoricVariableUpdateEntity.

Specified by:
removeVariableLocal in interface VariableScope

getSourceActivityVariableScope

protected VariableScope getSourceActivityVariableScope()

removeVariableLocal

protected void removeVariableLocal(String variableName,
                                   VariableScope sourceActivityExecution)

deleteVariableInstanceForExplicitUserCall

protected void deleteVariableInstanceForExplicitUserCall(VariableInstanceEntity variableInstance,
                                                         VariableScope sourceActivityExecution)

updateVariableInstance

protected void updateVariableInstance(VariableInstanceEntity variableInstance,
                                      Object value,
                                      VariableScope sourceActivityExecution)

createVariableInstance

protected VariableInstanceEntity createVariableInstance(String variableName,
                                                        Object value,
                                                        VariableScope sourceActivityExecution)

fireHistoricVariableInstanceDelete

protected void fireHistoricVariableInstanceDelete(VariableInstanceEntity variableInstance,
                                                  VariableScope sourceActivityExecution)

fireHistoricVariableInstanceCreate

protected void fireHistoricVariableInstanceCreate(VariableInstanceEntity variableInstance,
                                                  VariableScope sourceActivityExecution)

fireHistoricVariableInstanceUpdate

protected void fireHistoricVariableInstanceUpdate(VariableInstanceEntity variableInstance,
                                                  VariableScope sourceActivityExecution)

isAutoFireHistoryEvents

protected boolean isAutoFireHistoryEvents()
Returns:
true if this variable scope should automatically fire history events for variable modifications.

getCachedElContext

public ELContext getCachedElContext()

setCachedElContext

public void setCachedElContext(ELContext cachedElContext)

getId

public String getId()

setId

public void setId(String id)


Copyright © 2014 camunda services GmbH. All Rights Reserved.