public class Context extends Object implements XmlEntity, Collectible, ModelInstanceAware, EntityWithId, ModelIdentifiable, EvaluationLevelAware, TraceableExecution
Value
.Modifier | Constructor and Description |
---|---|
protected |
Context()
Creates new empty instance of
Context . |
|
Context(long id,
ModelInstance modelInstance,
Context parentContext,
com.whitestein.lsps.model.ContextModelElement element)
Creates new instance of
Context for given ProcessModel . |
|
Context(long id,
ModelInstance modelInstance,
Context parentContext,
String name)
Creates new instance of
Context . |
|
Context(long id,
ModelInstance modelInstance,
Context parentContext,
String name,
Long recordValueId,
String level,
Long baseLevelContextId,
Long lowestLevelContextId,
Long lowerLevelContextId)
Creates new instance of
Context . |
|
Context(long id,
ModelInstance modelInstance,
Context parentContext,
String name,
String level,
Long baseLevelContextId,
Long lowestLevelContextId,
Long lowerLevelContextId)
Creates new instance of
Context . |
|
Context(ModelInstance modelInstance,
Context parentContext,
com.whitestein.lsps.model.ContextModelElement element)
Creates new instance of
Context for given ProcessModel . |
|
Context(ModelInstance modelInstance,
Context parentContext,
String name)
Creates new instance of
Context . |
|
Context(ModelInstance modelInstance,
Context parentContext,
String name,
String level,
Long baseLevelContextId,
Long lowestLevelContextId,
Long lowerLevelContextId)
Creates new instance of
Context . |
Modifier and Type | Method and Description |
---|---|
void |
addAllFreeTypesFrom(Context aContext) |
Context |
addChildContext(Context context)
Adds context as child of this context.
|
void |
addExecutionTrace(ExecutionTrace et)
Adds ExecutionTrace to the context.
|
void |
addExecutionTraceElement(ExecutionTraceElement ete)
Adds ExecutionTraceElement to the context.
|
Context |
addNewChildContext(com.whitestein.lsps.model.ContextModelElement element)
Adds new child context.
|
Context |
addNewChildContext(String name)
Adds new child context.
|
Variable |
addNewVariable(String name,
String type)
Adds a new variable.
|
Variable |
addNewVariable(String name,
String type,
Value value,
boolean isReadOnly)
Adds a new variable.
|
Variable |
addVariable(Variable var)
Adds new variable.
|
void |
clear()
Clears variables.
|
void |
collect()
Removes itself from the process.
|
void |
collectTree()
Collects this context and all its children (recursivelly).
|
boolean |
containsVariable(String name)
Returns true if this context contains variable with given name.
|
NamespaceModel |
createNamespaceModel(ModelProviderClientService modelProviderService)
Creates namespace model for this.
|
Set<String> |
getAllFreeTypeNames()
Returns all free type names.
|
Context |
getBaseLevelEntity()
Returns base level context.
|
Long |
getBaseLevelEntityId()
Returns id of the corresponding context in base level.
|
Collection<Context> |
getChildContexts()
Returns immutable collection of child contexts.
|
Type |
getCompiledType(ModelProviderClientService modelProviderService,
String typeName)
Returns the compiled type.
|
Context |
getContextState(String name)
Returns child
Context by its name. |
com.whitestein.lsps.model.ContextModelElement |
getElement(ModelProviderClientService modelProviderService)
Returns the model element.
|
String |
getElementId()
Returns the element id.
|
String |
getElementId(ModelProviderClientService modelProviderService)
Returns the model element id.
|
String |
getEvaluationLevel()
Returns evaluation level of this value.
|
ExecutionTrace |
getExecutionTrace() |
ContextFreeType |
getFreeType(String name)
Returns free type value for given name or null if it does not exist.
|
FreeTypeMapping |
getFreeTypeMapping(ModelProviderClientService modelProviderService)
Returns free type mappings for this context.
|
List<ContextFreeType> |
getFreeTypes()
Returns free types.
|
long |
getId()
Returns the id.
|
Context |
getLowerLevelEntity()
Returns lower level context.
|
Long |
getLowerLevelEntityId()
Returns id of the corresponding context in previous lower level.
|
Context |
getLowestLevelEntity()
Returns lowest level context.
|
Long |
getLowestLevelEntityId()
Returns id of the corresponding context in the lowest exiting level.
|
ModelInstance |
getModelInstance()
Returns the model instance.
|
ModuleInstance |
getModuleInstance()
Returns the enclosing module.
|
String |
getName()
Returns name of this context.
|
NamespaceModel |
getNamespaceModel(ModelProviderClientService modelProviderService)
Returns namespace model
|
Context |
getParentContext()
Returns the parent context or null if this is top module context.
|
String |
getPath()
Returns the full path to this element as a string.
|
QID |
getPathQID()
Returns the full path to this element as a QID.
|
ProcessInstance |
getProcessInstance()
Returns the process instance containing this context, can be null.
|
ComplexValue |
getRecordValue()
Returns record value.
|
Long |
getRecordValueId()
Returns id of record value.
|
Collection<Collectible> |
getReferences()
Returns collection of all referenced collectible objects.
|
Context |
getTopContext()
Returns the top module context.
|
Variable |
getVariableInstance(String name)
Returns variable instance by variable name or null if it does not exist.
|
Set<String> |
getVariableNames()
Returns the names of the variables.
|
Collection<Variable> |
getVariables()
Returns immutable collection of variables.
|
Value |
getVariableValue(String name)
Returns variable value for given name or null if it does not exist.
|
boolean |
hasParent(Context ctx)
Returns true if any of the parents (not only direct one) is the specified context.
|
String |
internalVersionConflictMessage(EvaluationLevelAware entity)
Returns message for internal versioning conflict.
|
boolean |
isInternalyVersioned()
Returns true if the entity is internally (in scope of model instance) versioned.
|
boolean |
isLocked()
Returns true if the context is read only.
|
boolean |
isLowestExistingEntity()
Returns true if this entity is the lowest existing entity.
|
boolean |
isPerformingReadOnlyCheck()
Returns true if read only check on variables is performed.
|
boolean |
isPersistent()
Returns true if this object cannot be collected.
|
Context |
makeCopy(ModelInstance targetModelInstance)
Returns deep copy.
|
void |
postUnmarshal(javax.xml.bind.Unmarshaller unmarshaller,
Object parent)
Callback method invoked after unmarshalling XML data into target.
|
void |
preUnmarshal(javax.xml.bind.Unmarshaller unmarshaller,
Object parent)
Callback method invoked before unmarshalling into target.
|
void |
rebind(ModelInstance modelInstance)
Re-binds to a model instance.
|
boolean |
removeChildContext(Context context)
Removes a child context.
|
void |
replaceIdAndEvaluationLevel(Long newId,
Long newBaseId,
String newEvaluationLevel)
Replace id, base evaluation level entity id and evaluation level in the entity.
|
void |
replaceReferencedIds(Map<Long,Long> replacementMap)
Replace referenced ids according to mappings in the replacement map.
|
void |
setElementId(String elementId)
Sets element id.
|
void |
setFreeType(String name,
String type)
Sets the free type.
|
void |
setIsPerformingReadOlnycheck(boolean isPerformingCheck)
Allows/disallow to perform read only check on variables.
|
void |
setVariableValue(String name,
Value value)
Sets variable value for given name.
|
String |
toString() |
void |
updateLevelData(Long baseLevelContextId,
Long lowestLevelContextId,
Long lowerLevelContextId)
Updates references to the corresponding elements in other evaluation levels.
|
protected Context()
Context
.public Context(long id, ModelInstance modelInstance, Context parentContext, String name, Long recordValueId, String level, Long baseLevelContextId, Long lowestLevelContextId, Long lowerLevelContextId)
Context
.id
- modelInstance
- parentContext
- name
- recordValueId
- level
- baseLevelContextId
- lowestLevelContextId
- lowerLevelContextId
- NullPointerException
- if moduleInstance
or name
public Context(long id, ModelInstance modelInstance, Context parentContext, String name, String level, Long baseLevelContextId, Long lowestLevelContextId, Long lowerLevelContextId)
Context
.id
- modelInstance
- parentContext
- name
- level
- baseLevelContextId
- lowestLevelContextId
- lowerLevelContextId
- NullPointerException
- if moduleInstance
or name
public Context(ModelInstance modelInstance, Context parentContext, String name, String level, Long baseLevelContextId, Long lowestLevelContextId, Long lowerLevelContextId)
Context
.modelInstance
- parentContext
- name
- level
- baseLevelContextId
- lowestLevelContextId
- lowerLevelContextId
- NullPointerException
- if moduleInstance
or name
public Context(long id, ModelInstance modelInstance, Context parentContext, String name)
Context
.id
- modelInstance
- parentContext
- name
- NullPointerException
- if moduleInstance
or name
public Context(ModelInstance modelInstance, Context parentContext, String name)
Context
.modelInstance
- parentContext
- name
- NullPointerException
- if moduleInstance
or name
public Context(ModelInstance modelInstance, Context parentContext, com.whitestein.lsps.model.ContextModelElement element)
Context
for given ProcessModel
.
It creates the context as a top context.modelInstance
- parentContext
- element
- NullPointerException
- if modelInstance
or moduleInstance
or
element
is nullpublic Context(long id, ModelInstance modelInstance, Context parentContext, com.whitestein.lsps.model.ContextModelElement element)
Context
for given ProcessModel
.
It creates the context as a top context.id
- modelInstance
- parentContext
- element
- NullPointerException
- if modelInstance
or moduleInstance
or
element
is nullpublic long getId()
EntityWithId
getId
in interface EntityWithId
public String getName()
public Long getRecordValueId()
public ComplexValue getRecordValue()
public QID getPathQID()
public String getPath()
public Context getParentContext()
public Context getTopContext()
public boolean hasParent(Context ctx)
ctx
- public Collection<Context> getChildContexts()
public Context getContextState(String name)
Context
by its name.name
- Context
by its namepublic Context addChildContext(Context context)
context
- public boolean removeChildContext(Context context)
context
- public Context addNewChildContext(com.whitestein.lsps.model.ContextModelElement element)
element
- NullPointerException
- if element
is nullpublic Context addNewChildContext(String name)
name
- NullPointerException
- if name
is nullpublic boolean containsVariable(String name)
name
- variable namepublic Collection<Variable> getVariables()
public Set<String> getVariableNames()
public Variable getVariableInstance(String name)
name
- public Value getVariableValue(String name)
name
- public void setVariableValue(String name, Value value)
name
- value
- IllegalArgumentException
- if given variable does not existNullPointerException
- if value
is nullpublic String getElementId()
public String getElementId(ModelProviderClientService modelProviderService)
ModelIdentifiable
getElementId
in interface ModelIdentifiable
public void setElementId(String elementId)
elementId
- public com.whitestein.lsps.model.ContextModelElement getElement(ModelProviderClientService modelProviderService)
ModelIdentifiable
getElement
in interface ModelIdentifiable
public boolean isPersistent()
Collectible
isPersistent
in interface Collectible
public Collection<Collectible> getReferences()
Collectible
getReferences
in interface Collectible
public void collect()
Collectible
collect
in interface Collectible
public void collectTree()
public Variable addVariable(Variable var)
var
- IllegalArgumentException
- if a variable with the same name already existpublic Variable addNewVariable(String name, String type)
name
- type
- IllegalArgumentException
- if a variable with the same name already existpublic Variable addNewVariable(String name, String type, Value value, boolean isReadOnly)
name
- type
- value
- isReadOnly
- IllegalArgumentException
- if a variable with the same name already existpublic List<ContextFreeType> getFreeTypes()
public void addAllFreeTypesFrom(Context aContext)
public ContextFreeType getFreeType(String name)
name
- NullPointerException
- if name
is nullpublic void setFreeType(String name, String type)
name
- type
- NullPointerException
- if name
or type
is nullpublic ProcessInstance getProcessInstance()
public ModelInstance getModelInstance()
ModelInstanceAware
getModelInstance
in interface ModelInstanceAware
public ModuleInstance getModuleInstance()
public boolean isLocked()
isLocked
in interface EvaluationLevelAware
public void preUnmarshal(javax.xml.bind.Unmarshaller unmarshaller, Object parent)
UnmarshalCallback
preUnmarshal
in interface UnmarshalCallback
parent
- instance of JAXB mapped class that will eventually reference target.
null when target is root element.public void postUnmarshal(javax.xml.bind.Unmarshaller unmarshaller, Object parent)
UnmarshalCallback
postUnmarshal
in interface UnmarshalCallback
parent
- instance of JAXB mapped class that will reference target.
null when target is root element.public String getEvaluationLevel()
getEvaluationLevel
in interface EvaluationLevelAware
public void updateLevelData(Long baseLevelContextId, Long lowestLevelContextId, Long lowerLevelContextId)
EvaluationLevelAware
updateLevelData
in interface EvaluationLevelAware
public Long getBaseLevelEntityId()
getBaseLevelEntityId
in interface EvaluationLevelAware
public Context getBaseLevelEntity()
getBaseLevelEntity
in interface EvaluationLevelAware
public Long getLowestLevelEntityId()
getLowestLevelEntityId
in interface EvaluationLevelAware
public Context getLowestLevelEntity()
getLowestLevelEntity
in interface EvaluationLevelAware
public boolean isLowestExistingEntity()
EvaluationLevelAware
isLowestExistingEntity
in interface EvaluationLevelAware
public Long getLowerLevelEntityId()
getLowerLevelEntityId
in interface EvaluationLevelAware
public Context getLowerLevelEntity()
getLowerLevelEntity
in interface EvaluationLevelAware
public NamespaceModel getNamespaceModel(ModelProviderClientService modelProviderService)
modelProviderService
- public NamespaceModel createNamespaceModel(ModelProviderClientService modelProviderService)
modelProviderService
- public FreeTypeMapping getFreeTypeMapping(ModelProviderClientService modelProviderService)
modelProviderService
- public Set<String> getAllFreeTypeNames()
public Type getCompiledType(ModelProviderClientService modelProviderService, String typeName)
modelProviderService
- typeName
- public void replaceIdAndEvaluationLevel(Long newId, Long newBaseId, String newEvaluationLevel)
EvaluationLevelAware
replaceIdAndEvaluationLevel
in interface EvaluationLevelAware
public void replaceReferencedIds(Map<Long,Long> replacementMap)
replaceReferencedIds
in interface EvaluationLevelAware
replacementMap
- public void rebind(ModelInstance modelInstance)
rebind
in interface ModelInstanceAware
modelInstance
- public void clear()
clear
in interface EvaluationLevelAware
public boolean isInternalyVersioned()
EvaluationLevelAware
isInternalyVersioned
in interface EvaluationLevelAware
public String internalVersionConflictMessage(EvaluationLevelAware entity)
EvaluationLevelAware
internalVersionConflictMessage
in interface EvaluationLevelAware
public void addExecutionTraceElement(ExecutionTraceElement ete)
TraceableExecution
ExecutionTrace
and
ExecutionTraceElement
.addExecutionTraceElement
in interface TraceableExecution
ete
- ExecutionTraceElement to be added.public void addExecutionTrace(ExecutionTrace et)
TraceableExecution
ExecutionTrace
and
ExecutionTraceElement
.addExecutionTrace
in interface TraceableExecution
et
- ExecutionTrace to be added.public ExecutionTrace getExecutionTrace()
getExecutionTrace
in interface TraceableExecution
ExecutionTrace
and
ExecutionTraceElement
.public Context makeCopy(ModelInstance targetModelInstance)
targetModelInstance
- public boolean isPerformingReadOnlyCheck()
public void setIsPerformingReadOlnycheck(boolean isPerformingCheck)
isPerformingCheck
- Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.