Class DefaultContextAssociationManager
- java.lang.Object
-
- org.camunda.bpm.engine.cdi.impl.context.DefaultContextAssociationManager
-
- All Implemented Interfaces:
java.io.Serializable
,ContextAssociationManager
public class DefaultContextAssociationManager extends java.lang.Object implements ContextAssociationManager, java.io.Serializable
Default implementation of the business process association manager. Uses a fallback-strategy to associate the process instance with the "broadest" active scope, starting with the conversation. Subclass in order to implement custom association schemes and association with custom scopes.- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.logging.Logger
log
-
Constructor Summary
Constructors Constructor Description DefaultContextAssociationManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disAssociate()
Disassociates the current process instance with a context / scopeprotected void
ensureCommandContextNotActive()
void
flushVariableCache()
allows to flush the cached variables.protected java.util.List<java.lang.Class<? extends ScopedAssociation>>
getAvailableScopedAssociationClasses()
Override to add different / additional contexts.protected java.lang.Class<? extends ScopedAssociation>
getBroadestActiveContext()
VariableMap
getCachedLocalVariables()
VariableMap
getCachedVariables()
Execution
getExecution()
get the current executionprotected ExecutionEntity
getExecutionFromContext()
java.lang.String
getExecutionId()
protected ScopedAssociation
getScopedAssociation()
Task
getTask()
get the current taskTypedValue
getVariable(java.lang.String variableName)
get a process variableTypedValue
getVariableLocal(java.lang.String variableName)
get a local process variablevoid
setExecution(Execution execution)
associate with the provided executionvoid
setTask(Task task)
set a current taskvoid
setVariable(java.lang.String variableName, java.lang.Object value)
set a process variablevoid
setVariableLocal(java.lang.String variableName, java.lang.Object value)
set a local process variable
-
-
-
Method Detail
-
getBroadestActiveContext
protected java.lang.Class<? extends ScopedAssociation> getBroadestActiveContext()
-
getAvailableScopedAssociationClasses
protected java.util.List<java.lang.Class<? extends ScopedAssociation>> getAvailableScopedAssociationClasses()
Override to add different / additional contexts.
-
getScopedAssociation
protected ScopedAssociation getScopedAssociation()
-
setExecution
public void setExecution(Execution execution)
Description copied from interface:ContextAssociationManager
associate with the provided execution- Specified by:
setExecution
in interfaceContextAssociationManager
-
disAssociate
public void disAssociate()
Description copied from interface:ContextAssociationManager
Disassociates the current process instance with a context / scope- Specified by:
disAssociate
in interfaceContextAssociationManager
-
getExecutionId
public java.lang.String getExecutionId()
- Specified by:
getExecutionId
in interfaceContextAssociationManager
- Returns:
- the id of the execution currently associated or null
-
getExecution
public Execution getExecution()
Description copied from interface:ContextAssociationManager
get the current execution- Specified by:
getExecution
in interfaceContextAssociationManager
-
getVariable
public TypedValue getVariable(java.lang.String variableName)
Description copied from interface:ContextAssociationManager
get a process variable- Specified by:
getVariable
in interfaceContextAssociationManager
-
setVariable
public void setVariable(java.lang.String variableName, java.lang.Object value)
Description copied from interface:ContextAssociationManager
set a process variable- Specified by:
setVariable
in interfaceContextAssociationManager
-
getVariableLocal
public TypedValue getVariableLocal(java.lang.String variableName)
Description copied from interface:ContextAssociationManager
get a local process variable- Specified by:
getVariableLocal
in interfaceContextAssociationManager
-
setVariableLocal
public void setVariableLocal(java.lang.String variableName, java.lang.Object value)
Description copied from interface:ContextAssociationManager
set a local process variable- Specified by:
setVariableLocal
in interfaceContextAssociationManager
-
getExecutionFromContext
protected ExecutionEntity getExecutionFromContext()
-
getTask
public Task getTask()
Description copied from interface:ContextAssociationManager
get the current task- Specified by:
getTask
in interfaceContextAssociationManager
-
setTask
public void setTask(Task task)
Description copied from interface:ContextAssociationManager
set a current task- Specified by:
setTask
in interfaceContextAssociationManager
-
getCachedVariables
public VariableMap getCachedVariables()
- Specified by:
getCachedVariables
in interfaceContextAssociationManager
- Returns:
- a
VariableMap
of process variables cached between flushes
-
getCachedLocalVariables
public VariableMap getCachedLocalVariables()
- Specified by:
getCachedLocalVariables
in interfaceContextAssociationManager
- Returns:
- a
VariableMap
of local process variables cached between flushes
-
flushVariableCache
public void flushVariableCache()
Description copied from interface:ContextAssociationManager
allows to flush the cached variables.- Specified by:
flushVariableCache
in interfaceContextAssociationManager
-
ensureCommandContextNotActive
protected void ensureCommandContextNotActive()
-
-