public class ProcessThread extends Object implements ITaskContext
Modifier and Type | Field and Description |
---|---|
int |
idcnt
The id counter for sub processes.
|
List |
splitinfos
The split info stack (splitid, threadnumber).
|
Constructor and Description |
---|
ProcessThread(String id,
MActivity activity,
ThreadContext context,
BpmnInterpreter instance)
Create a new process instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Map |
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.
|
int |
getSplitCount()
Get the current split count.
|
int |
getSplitDepth()
Get the current split depth.
|
int |
getSplitId()
Get the current split id.
|
List |
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)?
|
int[] |
peakSplitInfo()
Get the topmost split info.
|
int[] |
popSplitInfo()
Remove the split info.
|
void |
pushSplitInfo(int splitid,
int splitcount)
Set the splitid.
|
void |
removeParameterValue(String name)
Remove the value of a parameter.
|
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 |
setSplitInfos(List splitinfos)
Set the split infos.
|
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 int idcnt
public List splitinfos
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 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 Map getData()
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 void setSplitInfos(List splitinfos)
public List getSplitInfos()
public void pushSplitInfo(int splitid, int splitcount)
splitid
- The splitid to set.public int[] popSplitInfo()
public int[] peakSplitInfo()
public int getSplitId()
public int getSplitCount()
public int getSplitDepth()
Copyright © 2012. All Rights Reserved.