public class BpmnInterpreter extends jadex.kernelbase.AbstractInterpreter implements IComponentInstance, IInternalAccess
Modifier and Type | Field and Description |
---|---|
static String |
ALL
The flag for all pools.
|
static Map |
DEFAULT_ACTIVITY_HANDLERS
The activity execution handlers (activity type -> handler).
|
static Map |
DEFAULT_STEP_HANDLERS
The step execution handlers (activity type -> handler).
|
static String |
TYPE_ACTIVITY
Constant for step event.
|
static String |
TYPE_THREAD
The change event prefix denoting a thread event.
|
Constructor and Description |
---|
BpmnInterpreter(IComponentAdapter adapter,
MBpmnModel model,
Map arguments,
String config,
IExternalAccess parent,
Map activityhandlers,
Map stephandlers,
IValueFetcher fetcher,
IComponentManagementService cms,
IClockService cs,
IMessageService ms,
IServiceContainer container)
Create a new bpmn process.
|
BpmnInterpreter(IComponentDescription desc,
IComponentAdapterFactory factory,
MBpmnModel model,
Map arguments,
String config,
IExternalAccess parent,
Map activityhandlers,
Map stephandlers,
IValueFetcher fetcher,
RequiredServiceBinding[] bindings,
boolean copy,
Future<Tuple2<IComponentInstance,IComponentAdapter>> inited)
Create a new bpmn process.
|
Modifier and Type | Method and Description |
---|---|
IFuture |
cleanupComponent()
Can be called concurrently (also during executeAction()).
|
IComponentChangeEvent |
createActivityEvent(String type,
ProcessThread thread,
MActivity activity)
Create an activity event (start, end).
|
ProcessThreadInfo |
createProcessThreadInfo(ProcessThread thread) |
Map |
createReply(IMessageAdapter msg)
Create a reply to this message event.
|
Map |
createReply(Map msg,
MessageType mt)
Create a reply to this message event.
|
IComponentChangeEvent |
createThreadEvent(String type,
ProcessThread thread)
Create a thread event (creation, modification, termination).
|
boolean |
executeStep()
Can be called on the component thread only.
|
void |
executeStep(String pool,
String lane)
Execute one step of the process.
|
IActivityHandler |
getActivityHandler(MActivity activity)
Get the activity handler for an activity.
|
Object |
getContextVariable(String name)
Get the value of the given context variable.
|
IValueFetcher |
getFetcher()
Get the value fetcher.
|
IInternalAccess |
getInternalAccess()
Get the internal access.
|
MBpmnModel |
getModelElement()
Get the model of the BPMN process instance.
|
ThreadContext |
getThreadContext()
Get the thread context.
|
boolean |
hasContextVariable(String name)
Test if the given context variable is declared.
|
boolean |
isAtBreakpoint(String[] breakpoints)
Test if the component's execution is currently at one of the
given breakpoints.
|
boolean |
isExternalThread()
Check if the external thread is accessing.
|
boolean |
isFinished(String pool,
String lane)
Check, if the process has terminated.
|
boolean |
isReady(String pool,
String lane)
Check if the process is ready, i.e. if at least one process thread can currently execute a step.
|
void |
messageArrived(IMessageAdapter message)
Can be called concurrently (also during executeAction()).
|
void |
notify(MActivity activity,
ProcessThread thread,
Object event)
Method that should be called, when an activity is finished and the following activity should be scheduled.
|
IFuture |
scheduleStep(IComponentStep step) |
void |
setContextVariable(String name,
Object value)
Set the value of the given context variable.
|
void |
setContextVariable(String name,
Object key,
Object value)
Set the value of the given context variable.
|
void |
startBehavior()
Start the component behavior.
|
void |
step(MActivity activity,
BpmnInterpreter instance,
ProcessThread thread,
Object event)
Make a process step, i.e. find the next edge or activity for a just executed thread.
|
IFuture |
waitFor(long delay,
IComponentStep step)
Wait for some time and execute a component step afterwards.
|
addArgument, addComponentListener, addDefaultResult, addExtension, addProperty, createServiceContainer, getArguments, getBindings, getComponentAdapter, getComponentListeners, getConfiguration, getCreationTime, getExtension, getExtensions, getExternalAccess, getInternalComponentListeners, getModel, getParent, getProperties, getResults, getServiceBindings, getServiceContainer, isCopy, removeComponentListener, setResultValue
addService, componentCreated, componentDestroyed, createComponent, createResultListener, createResultListener, getArguments, getChildren, getChildren, getClassLoader, getComponentDescription, getComponentFilename, getComponentIdentifier, getLocalType, getLogger, getName, getName, getNumber, getProperty, getRawService, getRawService, getRawServices, getServicePrefix, getServiceProvider, init, initArguments, initComponents, initExtensions, initFutureProperties, initServices, killComponent, notifyListeners, startEndSteps, startInitialSteps, startServiceContainer, terminateExtensions, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
componentCreated, componentDestroyed, getClassLoader, getExternalAccess, getProperty, getResults, getServiceContainer
addComponentListener, createResultListener, createResultListener, getArguments, getChildren, getComponentIdentifier, getConfiguration, getExternalAccess, getLogger, getModel, getParent, getResults, getServiceContainer, killComponent, removeComponentListener, setResultValue
public static final String TYPE_ACTIVITY
public static final String TYPE_THREAD
public static final Map DEFAULT_ACTIVITY_HANDLERS
public static final Map DEFAULT_STEP_HANDLERS
public static final String ALL
public BpmnInterpreter(IComponentAdapter adapter, MBpmnModel model, Map arguments, String config, IExternalAccess parent, Map activityhandlers, Map stephandlers, IValueFetcher fetcher, IComponentManagementService cms, IClockService cs, IMessageService ms, IServiceContainer container)
adapter
- The adapter.public BpmnInterpreter(IComponentDescription desc, IComponentAdapterFactory factory, MBpmnModel model, Map arguments, String config, IExternalAccess parent, Map activityhandlers, Map stephandlers, IValueFetcher fetcher, RequiredServiceBinding[] bindings, boolean copy, Future<Tuple2<IComponentInstance,IComponentAdapter>> inited)
adapter
- The adapter.public boolean executeStep()
executeStep
in interface IComponentInstance
executeStep
in class jadex.kernelbase.StatelessAbstractInterpreter
public void startBehavior()
startBehavior
in interface IComponentInstance
startBehavior
in class jadex.kernelbase.StatelessAbstractInterpreter
public void messageArrived(IMessageAdapter message)
messageArrived
in interface IComponentInstance
messageArrived
in class jadex.kernelbase.StatelessAbstractInterpreter
message
- The message that arrived.public IFuture cleanupComponent()
cleanupComponent
in interface IComponentInstance
cleanupComponent
in class jadex.kernelbase.StatelessAbstractInterpreter
listener
- When cleanup of the agent is finished, the listener must be notified.public boolean isAtBreakpoint(String[] breakpoints)
isAtBreakpoint
in interface IComponentInstance
isAtBreakpoint
in class jadex.kernelbase.StatelessAbstractInterpreter
breakpoints
- An array of breakpoints.public boolean isExternalThread()
public MBpmnModel getModelElement()
public ThreadContext getThreadContext()
public boolean isFinished(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 executeStep(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 boolean isReady(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 notify(MActivity activity, ProcessThread thread, Object event)
activity
- The timing event activity.instance
- The process instance.thread
- The process thread.event
- The event that has occurred, if any.public IActivityHandler getActivityHandler(MActivity activity)
actvity
- The activity.public void step(MActivity activity, BpmnInterpreter instance, ProcessThread thread, Object event)
activity
- The activity to execute.instance
- The process instance.thread
- The process thread.public boolean hasContextVariable(String name)
name
- The variable name.public Object getContextVariable(String name)
name
- The variable name.public void setContextVariable(String name, Object value)
name
- The variable name.value
- The variable value.public void setContextVariable(String name, Object key, Object value)
name
- The variable name.value
- The variable value.public IFuture scheduleStep(IComponentStep step)
scheduleStep
in class jadex.kernelbase.StatelessAbstractInterpreter
public IFuture waitFor(long delay, IComponentStep step)
public ProcessThreadInfo createProcessThreadInfo(ProcessThread thread)
public IValueFetcher getFetcher()
getFetcher
in interface IInternalAccess
getFetcher
in class jadex.kernelbase.AbstractInterpreter
public IInternalAccess getInternalAccess()
getInternalAccess
in class jadex.kernelbase.StatelessAbstractInterpreter
public Map createReply(IMessageAdapter msg)
msgeventtype
- The message event type.public Map createReply(Map msg, MessageType mt)
msgeventtype
- The message event type.public IComponentChangeEvent createThreadEvent(String type, ProcessThread thread)
public IComponentChangeEvent createActivityEvent(String type, ProcessThread thread, MActivity activity)
Copyright © 2012. All Rights Reserved.