Package jadex.bpmn.runtime.impl
Class BpmnProcessFeature
java.lang.Object
jadex.bpmn.runtime.impl.BpmnProcessFeature
- All Implemented Interfaces:
IBpmnComponentFeature,IInternalBpmnComponentFeature
public class BpmnProcessFeature
extends Object
implements IInternalBpmnComponentFeature, IBpmnComponentFeature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, IActivityHandler> The activity handlers.static final Map<String, IActivityHandler> The activity execution handlers (activity type -> handler).static final Map<String, IStepHandler> The step execution handlers (activity type -> handler).protected intThe thread id counter.The messages waitqueue.protected jadex.rules.eca.RuleSystemThe rule system.protected BpmnProcessprotected Map<String, IStepHandler> The step handlers.protected ProcessThreadThe top level process thread.Fields inherited from interface jadex.bpmn.runtime.impl.IInternalBpmnComponentFeature
TYPE_ACTIVITY, TYPE_THREAD -
Constructor Summary
ConstructorsConstructorDescriptionFactory method constructor for instance level. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconstruct(Map<String, IActivityHandler> activityhandlers, Map<String, IStepHandler> stephandlers) Init method holds constructor code for both implementations.createProcessThreadInfo(ProcessThread thread) Create a new process thread info for logging / debug tools.getActivityHandler(MActivity activity) Get the activity handler for an activity.getActivityHandler(String type) Get the activity handler for an activity.getContextVariable(String name) Get the value of the given context variable.Get the messages.getModel()Get the top level thread (is not executed and just acts as top level thread container).booleanhasContextVariable(String name) Test if the given context variable is declared.voidinit()protected booleanisCurrentActivity(MActivity activity, ProcessThread thread) Test if the notification is relevant for the current thread.booleanCheck, if the process has terminated.booleanisFinished(String pool, String lane) Check, if the process has terminated.booleanisReady()Check if the process is ready, i.e.booleanCheck if the process is ready, i.e.voidnotify(MActivity activity, ProcessThread thread, Object event) Method that should be called, when an activity is finished and the following activity should be scheduled.voidsetContextVariable(String name, Object value) Set the value of the given context variable.voidsetContextVariable(String name, Object key, Object value) Set the value of the given context variable.voidstep(MActivity activity, jadex.core.IComponent instance, ProcessThread thread, Object event) Make a process step, i.e.void
-
Field Details
-
DEFAULT_ACTIVITY_HANDLERS
The activity execution handlers (activity type -> handler). -
DEFAULT_STEP_HANDLERS
The step execution handlers (activity type -> handler). -
rulesystem
protected jadex.rules.eca.RuleSystem rulesystemThe rule system. -
activityhandlers
The activity handlers. -
stephandlers
The step handlers. -
topthread
The top level process thread. -
messages
The messages waitqueue. -
idcnt
protected int idcntThe thread id counter. -
self
-
-
Constructor Details
-
BpmnProcessFeature
Factory method constructor for instance level.
-
-
Method Details
-
getComponent
-
getModel
-
construct
protected void construct(Map<String, IActivityHandler> activityhandlers, Map<String, IStepHandler> stephandlers) Init method holds constructor code for both implementations. -
init
public void init()- Specified by:
initin interfaceIInternalBpmnComponentFeature
-
terminate
public void terminate()- Specified by:
terminatein interfaceIInternalBpmnComponentFeature
-
hasContextVariable
Test if the given context variable is declared.- Specified by:
hasContextVariablein interfaceIInternalBpmnComponentFeature- Parameters:
name- The variable name.- Returns:
- True, if the variable is declared.
-
getContextVariable
Get the value of the given context variable.- Specified by:
getContextVariablein interfaceIInternalBpmnComponentFeature- Parameters:
name- The variable name.- Returns:
- The variable value.
-
setContextVariable
Set the value of the given context variable.- Specified by:
setContextVariablein interfaceIInternalBpmnComponentFeature- Parameters:
name- The variable name.value- The variable value.
-
setContextVariable
Set the value of the given context variable.- Specified by:
setContextVariablein interfaceIInternalBpmnComponentFeature- Parameters:
name- The variable name.value- The variable value.
-
createProcessThreadInfo
Create a new process thread info for logging / debug tools. -
getActivityHandler
Get the activity handler for an activity.- Specified by:
getActivityHandlerin interfaceIInternalBpmnComponentFeature- Parameters:
actvity- The activity.- Returns:
- The activity handler.
-
getActivityHandler
Get the activity handler for an activity.- Specified by:
getActivityHandlerin interfaceIInternalBpmnComponentFeature- Parameters:
type- The activity type.- Returns:
- The activity handler.
-
getTopLevelThread
Get the top level thread (is not executed and just acts as top level thread container).- Specified by:
getTopLevelThreadin interfaceIInternalBpmnComponentFeature
-
step
public void step(MActivity activity, jadex.core.IComponent instance, ProcessThread thread, Object event) Make a process step, i.e. find the next edge or activity for a just executed thread.- Specified by:
stepin interfaceIInternalBpmnComponentFeature- Parameters:
activity- The activity to execute.instance- The process instance.thread- The process thread.
-
notify
Method that should be called, when an activity is finished and the following activity should be scheduled. Can safely be called from external threads.- Specified by:
notifyin interfaceIInternalBpmnComponentFeature- Parameters:
activity- The timing event activity.thread- The process thread.event- The event that has occurred, if any.instance- The process instance.
-
isCurrentActivity
Test if the notification is relevant for the current thread. The normal test is if thread.getActivity().equals(activity). This method must handle the additional cases that the current activity of the thread is a multiple event activity or when the activity is a subprocess with an attached timer event. In this case the notification could be for one of the child/attached events. -
isReady
public boolean isReady()Check if the process is ready, i.e. if at least one process thread can currently execute a step.- Specified by:
isReadyin interfaceIInternalBpmnComponentFeature- Parameters:
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'.
-
isReady
Check if the process is ready, i.e. if at least one process thread can currently execute a step.- Specified by:
isReadyin interfaceIInternalBpmnComponentFeature- Parameters:
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'.
-
isFinished
public boolean isFinished()Check, if the process has terminated.- Specified by:
isFinishedin interfaceIInternalBpmnComponentFeature- Parameters:
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'.- Returns:
- True, when the process instance is finished with regards to the specified pool/lane. When both pool and lane are null, true is returned only when all pools/lanes are finished.
-
isFinished
Check, if the process has terminated.- Specified by:
isFinishedin interfaceIInternalBpmnComponentFeature- Parameters:
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'.- Returns:
- True, when the process instance is finished with regards to the specified pool/lane. When both pool and lane are null, true is returned only when all pools/lanes are finished.
-
getMessages
Get the messages.- Specified by:
getMessagesin interfaceIInternalBpmnComponentFeature- Returns:
- The messages
-