public class Token extends Object implements Collectible, ModelInstanceAware, EntityWithId, ModelIdentifiable, ElementInProcess
Constructor and Description |
---|
Token(long id,
ProcessInstance processInstance,
String modelId)
Creates new instance.
|
Token(ProcessInstance processInstance,
String modelId)
Creates new instance.
|
Token(SToken source,
ProcessInstance processInstance,
ModelInstance modelInstance)
Creates a new instance from the serialized companion.
|
Modifier and Type | Method and Description |
---|---|
void |
addProcessInstance(ProcessInstance processInstance)
Adds a process instance.
|
void |
addTimeout(String flowId,
Long timeout)
Sets the timeout.
|
void |
cleanTimeouts()
Cleans timeouts.
|
void |
collect()
Removes itself from the process.
|
Token |
createCopy(ModelInstance targetModelInstance)
Creates a copy without references to other objects.
|
void |
finish()
Finishes this token execution.
|
void |
finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source,
CopyHelper helper)
Copy references.
|
com.whitestein.lsps.model.FlowElement |
getElement(ModelProvider modelProvider)
Returns the model element.
|
String |
getElementId()
Returns the model element id.
|
String |
getElementId(ModelProvider modelProvider)
Returns the model element id.
|
Long |
getExecutionId()
Returns the execution id.
|
com.whitestein.lsps.model.Flow |
getFlow(ModelProvider modelProvider)
Returns the flow.
|
String |
getFlowId()
Returns the flow model id.
|
HandledBoundaryEvent |
getHandledBoundaryEvent(String elementId)
Returns handled boundary event with id.
|
List<HandledBoundaryEvent> |
getHandledBoundaryEvents()
Returns list of already handled boundary events.
|
long |
getId()
Returns the id.
|
ModelInstance |
getModelInstance()
Returns the model instance.
|
ProcessInstance |
getProcessInstance()
Returns the process instance.
|
int |
getProcessInstanceCount()
Returns the process instance count.
|
List<ProcessInstance> |
getProcessInstances()
Returns all the process instances.
|
Collection<Collectible> |
getReferences()
Returns collection of all referenced collectible objects.
|
Task |
getTask()
Returns the task.
|
Date |
getTimeout(String flowId)
Returns the timeout.add
|
List<TimeoutFlow> |
getTimeouts()
Returns an unmodifiable list of timeouts.
|
void |
interrupt(TerminationReason terminationReason)
Interrupts this token execution.
|
boolean |
isPersistent()
Returns true if this object cannot be collected.
|
boolean |
isStarted()
Returns true if interpretation of the corresponding model element is started by the engine.
|
void |
move(String elementId)
Move the token to the new element.
|
void |
move(String elementId,
String flowId)
Move the token to the new element by the flow.
|
void |
rebind(ModelInstance modelInstance)
Re-bind to the provided model instance.
|
void |
removeAllProcessInstances()
Removes all process instances.
|
void |
removeProcessInstance(ProcessInstance processInstance)
addXmlEntity
Removes a process instance.
|
void |
setExecutionId(Long executionId)
Sets the execution id.
|
void |
setTask(Task task)
Sets the task.
|
void |
start()
Starts this token execution.
|
SToken |
toSerializable(SModelInstance smi,
MarshallerConfig config)
Creates a serializable object.
|
public Token(ProcessInstance processInstance, String modelId)
processInstance
- modelId
- NullPointerException
- if processInstance
is nullpublic Token(long id, ProcessInstance processInstance, String modelId)
id
- processInstance
- modelId
- NullPointerException
- if processInstance
is nullpublic Token(SToken source, ProcessInstance processInstance, ModelInstance modelInstance)
source
- processInstance
- modelInstance
- public SToken toSerializable(SModelInstance smi, MarshallerConfig config)
smi
- config
- public long getId()
EntityWithId
getId
in interface EntityWithId
public String getElementId()
public String getElementId(ModelProvider modelProvider)
ModelIdentifiable
getElementId
in interface ModelIdentifiable
public com.whitestein.lsps.model.FlowElement getElement(ModelProvider modelProvider)
ModelIdentifiable
getElement
in interface ModelIdentifiable
public String getFlowId()
public com.whitestein.lsps.model.Flow getFlow(ModelProvider modelProvider)
modelProvider
- the model provider servicepublic ModelInstance getModelInstance()
ModelInstanceAware
getModelInstance
in interface ModelInstanceAware
public void rebind(ModelInstance modelInstance)
ModelInstanceAware
rebind
in interface ModelInstanceAware
public ProcessInstance getProcessInstance()
getProcessInstance
in interface ElementInProcess
public Long getExecutionId()
public void setExecutionId(Long executionId)
executionId
- public Task getTask()
public void setTask(Task task)
task
- public List<TimeoutFlow> getTimeouts()
public void cleanTimeouts()
public Date getTimeout(String flowId)
flowId
- public void addTimeout(String flowId, Long timeout)
flowId
- timeout
- public List<ProcessInstance> getProcessInstances()
public int getProcessInstanceCount()
public void addProcessInstance(ProcessInstance processInstance)
processInstance
- public void removeProcessInstance(ProcessInstance processInstance)
processInstance
- public void removeAllProcessInstances()
public boolean isStarted()
public void start()
public void finish()
public void interrupt(TerminationReason terminationReason)
terminationReason
- 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 move(String elementId, String flowId)
The movement of the token cause the following events to be fired in this order:
The first two events are fired before the state of the token is changed. The last event is fired after the token was moved to the next element.elementId
- the target element IDflowId
- the flow IDpublic void move(String elementId)
elementId
- public List<HandledBoundaryEvent> getHandledBoundaryEvents()
public HandledBoundaryEvent getHandledBoundaryEvent(String elementId)
elementId
- public Token createCopy(ModelInstance targetModelInstance)
public void finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source, CopyHelper helper)
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.