public class ProcessThread extends Object implements ITaskContext
Modifier and Type | Field and Description |
---|---|
int |
idcnt
The id counter for sub processes.
|
Map<String,SplitInfo> |
splitinfos
The split infos.
|
Constructor and Description |
---|
ProcessThread(String id,
MActivity activity,
ThreadContext context,
BpmnInterpreter instance)
Create a new process instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addSplitInfo(SplitInfo spi)
Add a split info.
|
boolean |
belongsTo(String pool,
String lane)
Test if the thread belongs to the given pool and/or lane.
|
ProcessThread |
createCopy()
Create a copy of this thread (e.g. for a parallel split).
|
MActivity |
getActivity()
Get the activity.
|
String |
getActivityId()
Get the activity id.
|
Map<String,Object> |
getData()
Get the data.
|
Exception |
getException()
Get the exception (if any).
|
String |
getId()
Get the id.
|
BpmnInterpreter |
getInstance()
Get the instance.
|
MSequenceEdge |
getLastEdge()
Get the last edge (if any).
|
MActivity |
getModelElement()
Get the model element.
|
String[] |
getParameterNames()
Get the name of all parameters.
|
Object |
getParameterValue(String name)
Get the value of a parameter.
|
Object |
getPropertyValue(String name)
Get the value of a property.
|
Object |
getPropertyValue(String name,
MActivity activity)
Hack: method is necessary because thread.activity is not always
the activity to execute in case of multiple event.
|
SplitInfo |
getSplitInfo(String id)
Get a specific split info, if available.
|
Collection<SplitInfo> |
getSplitInfos()
Get the split infos.
|
ITask |
getTask()
Gets the current task.
|
ThreadContext |
getThreadContext()
Get the thread context
|
IFilter |
getWaitFilter()
Get the wait filter.
|
Object |
getWaitInfo()
Get the waitinfo.
|
boolean |
hasOwnParameterValue(String name)
Test if a parameter has been set on activity.
|
boolean |
hasParameterValue(String name)
Test if a parameter has been set on activity.
|
boolean |
hasPropertyValue(String name)
Test, if a property is declared.
|
boolean |
isCanceled()
Is the current task canceled?
|
boolean |
isWaiting()
Is the process in a waiting state (i.e. blocked)?
|
void |
removeParameterValue(String name)
Remove the value of a parameter.
|
void |
removeSplitInfo(SplitInfo spi)
Remove the split info.
|
void |
setActivity(MActivity activity)
Set the next activity.
|
void |
setCanceled(boolean canceled)
Set the canceled state.
|
void |
setException(Exception exception)
Set the exception.
|
void |
setLastEdge(MSequenceEdge edge)
Set the last edge.
|
void |
setNonWaiting()
Set to non waiting.
|
void |
setParameterValue(String name,
Object value)
Set the value of a parameter.
|
void |
setParameterValue(String name,
Object key,
Object value)
Set the value of a parameter.
|
void |
setTask(ITask task)
Sets the current task.
|
void |
setThreadContext(ThreadContext context)
Set the context.
|
void |
setWaitFilter(IFilter waitfilter)
Set the wait filter.
|
void |
setWaitInfo(Object waitinfo)
Set the process waiting info.
|
void |
setWaiting(boolean waiting)
Set the waiting state.
|
String |
toString()
Create a string representation of this process thread.
|
void |
updateParametersAfterStep(MActivity activity,
BpmnInterpreter instance)
Remove in parameters after step.
|
public ProcessThread(String id, MActivity activity, ThreadContext context, BpmnInterpreter instance)
activity
- The current activity.public String getId()
public MActivity getActivity()
getActivity
in interface ITaskContext
public String getActivityId()
ITaskContext
getActivityId
in interface ITaskContext
public void setActivity(MActivity activity)
public boolean isCanceled()
public void setCanceled(boolean canceled)
canceled
- True, if canceled.public ITask getTask()
public void setTask(ITask task)
task
- The current task.public MSequenceEdge getLastEdge()
public void setLastEdge(MSequenceEdge edge)
edge
- The edge.public boolean isWaiting()
public void setWaiting(boolean waiting)
public void setNonWaiting()
public void setWaitInfo(Object waitinfo)
waiting
- The waiting info.public Object getWaitInfo()
public IFilter getWaitFilter()
public void setWaitFilter(IFilter waitfilter)
waitfilter
- The waitfilter to set.public ThreadContext getThreadContext()
public void setThreadContext(ThreadContext context)
context
- The context to set.public ProcessThread createCopy()
public boolean hasOwnParameterValue(String name)
name
- The parameter name.public boolean hasParameterValue(String name)
hasParameterValue
in interface ITaskContext
name
- The parameter name.public MActivity getModelElement()
getModelElement
in interface ITaskContext
public Object getParameterValue(String name)
getParameterValue
in interface ITaskContext
name
- The parameter name.public void setParameterValue(String name, Object value)
setParameterValue
in interface ITaskContext
name
- The parameter name.value
- The parameter value.public void setParameterValue(String name, Object key, Object value)
setParameterValue
in interface ITaskContext
name
- The parameter name.value
- The parameter value.key
- An optional helper (index, key etc.)public void removeParameterValue(String name)
name
- The parameter name.public String[] getParameterNames()
public Object getPropertyValue(String name)
getPropertyValue
in interface ITaskContext
name
- The property name.public Object getPropertyValue(String name, MActivity activity)
name
- The property name.public boolean hasPropertyValue(String name)
name
- The property name.public Exception getException()
public void setException(Exception exception)
exception
- The exception.public BpmnInterpreter getInstance()
public boolean belongsTo(String pool, String lane)
pool
- The pool to be executed or null for any.lane
- The lane to be executed or null for any. Nested lanes may be addressed by dot-notation, e.g. 'OuterLane.InnerLane'.public void updateParametersAfterStep(MActivity activity, BpmnInterpreter instance)
instance
- The calling BPMN instance.public Collection<SplitInfo> getSplitInfos()
public void addSplitInfo(SplitInfo spi)
public void removeSplitInfo(SplitInfo spi)
Copyright © 2012. All Rights Reserved.