public class ProcessInstance extends java.lang.Object implements Collectible, ModelInstanceAware, EntityWithId, ProcessInstanceParent, ModelIdentifiable
| Constructor and Description | 
|---|
ProcessInstance(ProcessInstanceParent parent,
               Context context)
Creates new instance of  
ProcessInstance. | 
ProcessInstance(SProcessInstance source,
               ProcessInstance parent,
               ModuleInstance moduleInstance,
               ModelInstance modelInstance)
Creates a new instance from the serialized companion. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addCommand(ActivationCommand cmd)
Adds an activation command. 
 | 
ProcessInstance | 
addNewProcessInstance(Context context)
Adds new child process instance. 
 | 
ProcessInstance | 
addNewProcessInstance(com.whitestein.lsps.model.ContextModelElement element)
Adds new child process instance. 
 | 
Token | 
addNewToken()
Adds a new token. 
 | 
Token | 
addNewToken(java.lang.String modelId)
Adds a new token. 
 | 
ProcessInstance | 
addProcessInstance(ProcessInstance processInstance)
Adds a process instances as a child of this process instance. 
 | 
Token | 
addToken(Token token)
Adds a token. 
 | 
void | 
collect()
Removes itself from the process. 
 | 
boolean | 
containsToken(Token token)
Returns true if this context contains given token. 
 | 
protected void | 
convertToDirectReferences()  | 
ProcessInstance | 
createCopy(ModelInstance targetModelInstance)
Creates a copy without references to other objects. 
 | 
ProcessInstance | 
findDescendant(long descendantId)
Finds a descendant process instance of this process instance. 
 | 
void | 
finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source,
          CopyHelper helper)
Copy references. 
 | 
Context | 
getContext()
Returns the process instance context. 
 | 
com.whitestein.lsps.model.ContextModelElement | 
getElement(ModelProvider modelProvider)
Returns the model element. 
 | 
java.lang.String | 
getElementId()
Returns the model id. 
 | 
java.lang.String | 
getElementId(ModelProvider modelProvider)
Returns the model element id. 
 | 
java.util.Collection<Goal> | 
getGoals()
Returns the collection of top goals. 
 | 
GOElement | 
getGOElement(java.lang.String name)
Returns the go element by its name. 
 | 
java.util.Collection<GOElement> | 
getGOElements()
Returns all go elements. 
 | 
long | 
getId()
Returns the id. 
 | 
java.lang.String | 
getIteratorValue()  | 
ModelInstance | 
getModelInstance()
Returns the model instance. 
 | 
ModuleInstance | 
getModuleInstance()
Returns the module. 
 | 
java.lang.String | 
getName()
Returns the context name. 
 | 
ProcessInstance | 
getParent()
Returns the parent process instance or null if this is a top process
 instance. 
 | 
com.whitestein.lsps.model.FlowElement | 
getParentModelElement(ModelProvider modelProvider)
Returns parent model element if exists. 
 | 
java.lang.String | 
getParentModelElementId()
Gets the identifier of a model element the execution of which produced
 this process instance. 
 | 
java.lang.String | 
getPath()
Returns the full path to this element as a string. 
 | 
QID | 
getPathQID()
Returns the full path to this element as a QID. 
 | 
java.util.Collection<ProcessInstance> | 
getProcessInstances()
Returns immutable collection of child process instances. 
 | 
java.util.Collection<Collectible> | 
getReferences()
Returns collection of all referenced collectible objects. 
 | 
ProcessInstanceState | 
getState()
Returns the state. 
 | 
java.util.Collection<Token> | 
getTokens()
Returns the tokens. 
 | 
ProcessInstance | 
getTopOfInlinedProcess()
Returns first parent that is not in-lined. 
 | 
void | 
interrupt(TerminationReason terminationReason)
Interrupts this process instance - i.e. 
 | 
boolean | 
isCommandsEmpty()
Returns true if the command queue is empty. 
 | 
boolean | 
isFinished()
Returns true if the state is  
ProcessInstanceState.FINISHED. | 
boolean | 
isInlined()
Returns true if the process is in-lined or some of its parent is in-lined. 
 | 
boolean | 
isNew()
Returns true if the state is  
ProcessInstanceState.CREATED. | 
boolean | 
isPersistent()
Returns true if this object cannot be collected. 
 | 
boolean | 
isRunning()
Returns true if the state is  
ProcessInstanceState.RUNNING. | 
boolean | 
isSuspended()
Returns true if the state is  
ProcessInstanceState.SUSPENDED. | 
boolean | 
isTerminatedByNoExit()
Returns true if process was terminated by no exit event. 
 | 
void | 
rebind(ModelInstance modelInstance)
Re-bind to the provided model instance. 
 | 
void | 
removeAllTokens()
Removes all tokens. 
 | 
ActivationCommand | 
removeFirstCommand()
Removes and returns the first command. 
 | 
boolean | 
removeProcessInstance(ProcessInstance processInstance)
Removes a process instance. 
 | 
void | 
removeToken(Token token,
           boolean isInterrupted)
Removes a token. 
 | 
void | 
setIsInlined(boolean isInlined)
Sets property isIlined. 
 | 
void | 
setIteratorValue(java.lang.String iteratorValue)  | 
void | 
setParentModelElementId(java.lang.String parentModelElementId)
Sets the identifier of a model element the execution of which produced
 this process instance. 
 | 
void | 
setState(ProcessInstanceState state)
Sets the state. 
 | 
void | 
setTerminatedByNoExit(boolean value)
Sets value whether process was terminated by no exit event 
 | 
void | 
startGoal(Goal goal)
Starts the goal execution. 
 | 
SProcessInstance | 
toSerializable(SProcessInstance parent,
              SModuleInstance module,
              SModelInstance smi,
              MarshallerConfig config)
Creates a serializable object. 
 | 
java.lang.String | 
toString()  | 
public ProcessInstance(ProcessInstanceParent parent, Context context)
ProcessInstance.parent - context - java.lang.NullPointerException - if moduleInstance or context is nullpublic ProcessInstance(SProcessInstance source, ProcessInstance parent, ModuleInstance moduleInstance, ModelInstance modelInstance)
source - parent - moduleInstance - modelInstance - public SProcessInstance toSerializable(SProcessInstance parent, SModuleInstance module, SModelInstance smi, MarshallerConfig config)
parent - module - smi - config - public ProcessInstanceState getState()
public void setState(ProcessInstanceState state)
state - java.lang.NullPointerException - if state is nullpublic void interrupt(TerminationReason terminationReason)
terminationReason - public boolean isFinished()
ProcessInstanceState.FINISHED.ProcessInstanceState.FINISHEDpublic boolean isRunning()
ProcessInstanceState.RUNNING.ProcessInstanceState.RUNNINGpublic boolean isSuspended()
ProcessInstanceState.SUSPENDED.ProcessInstanceState.SUSPENDEDpublic boolean isNew()
ProcessInstanceState.CREATED.ProcessInstanceState.CREATEDpublic long getId()
EntityWithIdgetId in interface EntityWithIdpublic java.lang.String getName()
public java.lang.String getElementId()
public java.lang.String getElementId(ModelProvider modelProvider)
ModelIdentifiablegetElementId in interface ModelIdentifiablepublic com.whitestein.lsps.model.ContextModelElement getElement(ModelProvider modelProvider)
ModelIdentifiablegetElement in interface ModelIdentifiablepublic Context getContext()
getContext in interface ProcessInstanceParentpublic ProcessInstance getParent()
public java.util.Collection<ProcessInstance> getProcessInstances()
public ProcessInstance addProcessInstance(ProcessInstance processInstance)
addProcessInstance in interface ProcessInstanceParentprocessInstance - public boolean removeProcessInstance(ProcessInstance processInstance)
removeProcessInstance in interface ProcessInstanceParentprocessInstance - public ProcessInstance addNewProcessInstance(com.whitestein.lsps.model.ContextModelElement element)
addNewProcessInstance in interface ProcessInstanceParentelement - java.lang.NullPointerException - if element is nullpublic ProcessInstance addNewProcessInstance(Context context)
addNewProcessInstance in interface ProcessInstanceParentcontext - java.lang.NullPointerException - if context is nullpublic java.util.Collection<Token> getTokens()
public Token addToken(Token token)
token - java.lang.NullPointerException - if token is nullpublic Token addNewToken()
public Token addNewToken(java.lang.String modelId)
modelId - public void removeToken(Token token, boolean isInterrupted)
token - isInterrupted - public void removeAllTokens()
public boolean containsToken(Token token)
token - public void startGoal(Goal goal)
goal - public java.util.Collection<Goal> getGoals()
public void addCommand(ActivationCommand cmd)
cmd - public boolean isCommandsEmpty()
public ActivationCommand removeFirstCommand()
public GOElement getGOElement(java.lang.String name)
name - public java.util.Collection<GOElement> getGOElements()
public boolean isPersistent()
CollectibleisPersistent in interface Collectiblepublic java.util.Collection<Collectible> getReferences()
CollectiblegetReferences in interface Collectiblepublic void collect()
Collectiblecollect in interface Collectiblepublic ModelInstance getModelInstance()
ModelInstanceAwaregetModelInstance in interface ModelInstanceAwarepublic void rebind(ModelInstance modelInstance)
ModelInstanceAwarerebind in interface ModelInstanceAwarepublic ModuleInstance getModuleInstance()
getModuleInstance in interface ProcessInstanceParentpublic QID getPathQID()
ProcessInstanceParentgetPathQID in interface ProcessInstanceParentpublic java.lang.String getPath()
ProcessInstanceParentgetPath in interface ProcessInstanceParentpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getParentModelElementId()
Gets the identifier of a model element the execution of which produced this process instance.
Model element which produce a new process instance when executed are:
public com.whitestein.lsps.model.FlowElement getParentModelElement(ModelProvider modelProvider)
modelProvider - public void setParentModelElementId(java.lang.String parentModelElementId)
parentModelElementId - the model element identifiergetParentModelElementId()public java.lang.String getIteratorValue()
public void setIteratorValue(java.lang.String iteratorValue)
iteratorValue - the iteratorValue to setpublic ProcessInstance findDescendant(long descendantId)
null is returned.descendantId - the identifier of the descendant process instancenull if there is no
                        descendant process instance with the given identifier.public ProcessInstance createCopy(ModelInstance targetModelInstance)
public void finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source,
                       CopyHelper helper)
public ProcessInstance getTopOfInlinedProcess()
public boolean isInlined()
public void setIsInlined(boolean isInlined)
isInlined - public void setTerminatedByNoExit(boolean value)
value - public boolean isTerminatedByNoExit()
protected void convertToDirectReferences()
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.