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 namepublic 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 namepublic 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 namepublic Context(long id,
ModelInstance modelInstance,
Context parentContext,
String name)
Context.id - modelInstance - parentContext - name - NullPointerException - if moduleInstance or namepublic Context(ModelInstance modelInstance, Context parentContext, String name)
Context.modelInstance - parentContext - name - NullPointerException - if moduleInstance or namepublic 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()
EntityWithIdgetId in interface EntityWithIdpublic 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)
ModelIdentifiablegetElementId in interface ModelIdentifiablepublic void setElementId(String elementId)
elementId - public com.whitestein.lsps.model.ContextModelElement getElement(ModelProviderClientService modelProviderService)
ModelIdentifiablegetElement in interface ModelIdentifiablepublic boolean isPersistent()
CollectibleisPersistent in interface Collectiblepublic Collection<Collectible> getReferences()
CollectiblegetReferences in interface Collectiblepublic void collect()
Collectiblecollect in interface Collectiblepublic 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()
ModelInstanceAwaregetModelInstance in interface ModelInstanceAwarepublic ModuleInstance getModuleInstance()
public boolean isLocked()
isLocked in interface EvaluationLevelAwarepublic void preUnmarshal(javax.xml.bind.Unmarshaller unmarshaller, Object parent)
UnmarshalCallbackpreUnmarshal in interface UnmarshalCallbackparent - 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)
UnmarshalCallbackpostUnmarshal in interface UnmarshalCallbackparent - instance of JAXB mapped class that will reference target.
null when target is root element.public String getEvaluationLevel()
getEvaluationLevel in interface EvaluationLevelAwarepublic void updateLevelData(Long baseLevelContextId, Long lowestLevelContextId, Long lowerLevelContextId)
EvaluationLevelAwareupdateLevelData in interface EvaluationLevelAwarepublic Long getBaseLevelEntityId()
getBaseLevelEntityId in interface EvaluationLevelAwarepublic Context getBaseLevelEntity()
getBaseLevelEntity in interface EvaluationLevelAwarepublic Long getLowestLevelEntityId()
getLowestLevelEntityId in interface EvaluationLevelAwarepublic Context getLowestLevelEntity()
getLowestLevelEntity in interface EvaluationLevelAwarepublic boolean isLowestExistingEntity()
EvaluationLevelAwareisLowestExistingEntity in interface EvaluationLevelAwarepublic Long getLowerLevelEntityId()
getLowerLevelEntityId in interface EvaluationLevelAwarepublic Context getLowerLevelEntity()
getLowerLevelEntity in interface EvaluationLevelAwarepublic 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)
EvaluationLevelAwarereplaceIdAndEvaluationLevel in interface EvaluationLevelAwarepublic void replaceReferencedIds(Map<Long,Long> replacementMap)
replaceReferencedIds in interface EvaluationLevelAwarereplacementMap - public void rebind(ModelInstance modelInstance)
rebind in interface ModelInstanceAwaremodelInstance - public void clear()
clear in interface EvaluationLevelAwarepublic boolean isInternalyVersioned()
EvaluationLevelAwareisInternalyVersioned in interface EvaluationLevelAwarepublic String internalVersionConflictMessage(EvaluationLevelAware entity)
EvaluationLevelAwareinternalVersionConflictMessage in interface EvaluationLevelAwarepublic void addExecutionTraceElement(ExecutionTraceElement ete)
TraceableExecutionExecutionTrace and
ExecutionTraceElement.addExecutionTraceElement in interface TraceableExecutionete - ExecutionTraceElement to be added.public void addExecutionTrace(ExecutionTrace et)
TraceableExecutionExecutionTrace and
ExecutionTraceElement.addExecutionTrace in interface TraceableExecutionet - ExecutionTrace to be added.public ExecutionTrace getExecutionTrace()
getExecutionTrace in interface TraceableExecutionExecutionTrace 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.