public class Token extends Object implements XmlEntity, Collectible, ModelInstanceAware, EntityWithId, ModelIdentifiable, ElementInProcess
Modifier | Constructor and Description |
---|---|
protected |
Token()
Creates empty instance.
|
|
Token(long id,
ProcessInstance processInstance,
String modelId)
Creates new instance.
|
|
Token(ProcessInstance processInstance,
String modelId)
Creates new instance.
|
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() |
void |
collect()
Removes itself from the process.
|
void |
finish()
Finishes this token execution.
|
com.whitestein.lsps.model.FlowElement |
getElement(ModelProviderClientService modelProviderService)
Returns the model element.
|
String |
getElementId()
Returns the model element id.
|
String |
getElementId(ModelProviderClientService modelProviderService)
Returns the model element id.
|
Long |
getExecutionId()
Returns the execution id.
|
com.whitestein.lsps.model.Flow |
getFlow(ModelProviderClientService modelProviderService)
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() |
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.
|
Token |
makeCopy(ModelInstance targetModelInstance,
ProcessInstance targetProcessInstance)
Returns deep copy.
|
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 |
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-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.
|
protected Token()
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 long getId()
EntityWithId
getId
in interface EntityWithId
public String getElementId()
public String getElementId(ModelProviderClientService modelProviderService)
ModelIdentifiable
getElementId
in interface ModelIdentifiable
public com.whitestein.lsps.model.FlowElement getElement(ModelProviderClientService modelProviderService)
ModelIdentifiable
getElement
in interface ModelIdentifiable
public String getFlowId()
public com.whitestein.lsps.model.Flow getFlow(ModelProviderClientService modelProviderService)
modelProviderService
- 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 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 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 makeCopy(ModelInstance targetModelInstance, ProcessInstance targetProcessInstance)
targetModelInstance
- targetProcessInstance
- Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.