public class BpmnInterpreter extends jadex.kernelbase.AbstractInterpreter implements 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,
boolean realtime,
IIntermediateResultListener<Tuple2<String,Object>> resultlistener,
Future<Void> inited)
Create a new bpmn process.
|
Modifier and Type | Method and Description |
---|---|
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.
|
ClassLoader |
getClassLoader()
Get the classloader.
|
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 |
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.
|
<T> IFuture<T> |
scheduleStep(IComponentStep<T> step)
Schedule a step of the agent.
|
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.
|
IFuture<Void> |
startEndSteps()
Start the end steps of the component.
|
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.
|
void |
streamArrived(IConnection con)
Can be called concurrently (also during executeAction()).
|
addArgument, addComponentListener, addDefaultResult, addExtension, addProperty, createServiceContainer, getArguments, getBindings, getComponentAdapter, getComponentListeners, getConfiguration, getExtension, getExtensions, getExternalAccess, getInternalComponentListeners, getModel, getParentAccess, getProperties, getResults, getServiceBindings, getServiceContainer, isCopy, isRealtime, removeComponentListener, setResultValue
addService, cleanupComponent, componentCreated, componentDestroyed, createComponent, createResultListener, createResultListener, getArguments, getChildren, getChildrenAccesses, getChildrenIdentifiers, getComponentDescription, getComponentFilename, getComponentIdentifier, getLocalType, getLogger, getName, getName, getNumber, getProperty, getRawService, getRawService, getRawServices, getServicePrefix, getServiceProvider, init, initArguments, initComponents, initExtension, initExtensions, initFutureProperties, initServices, isComponentThread, isExternalThread, killComponent, notifyListeners, startInitialSteps, startServiceContainer, terminateExtensions, terminateServiceContainer, toString, waitForDelay
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addComponentListener, createResultListener, createResultListener, getArguments, getChildrenAccesses, getChildrenIdentifiers, getComponentDescription, getComponentIdentifier, getConfiguration, getExternalAccess, getLogger, getModel, getParentAccess, getResults, getServiceContainer, isComponentThread, killComponent, removeComponentListener, setResultValue, waitForDelay
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, boolean realtime, IIntermediateResultListener<Tuple2<String,Object>> resultlistener, Future<Void> 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 void streamArrived(IConnection con)
streamArrived
in interface IComponentInstance
streamArrived
in class jadex.kernelbase.StatelessAbstractInterpreter
message
- The message that arrived.public IFuture<Void> startEndSteps()
startEndSteps
in class jadex.kernelbase.StatelessAbstractInterpreter
public boolean isAtBreakpoint(String[] breakpoints)
isAtBreakpoint
in interface IComponentInstance
isAtBreakpoint
in class jadex.kernelbase.StatelessAbstractInterpreter
breakpoints
- An array of breakpoints.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 <T> IFuture<T> scheduleStep(IComponentStep<T> step)
scheduleStep
in class jadex.kernelbase.StatelessAbstractInterpreter
step
- Code to be executed as a step of the agent.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)
public ClassLoader getClassLoader()
getClassLoader
in interface IComponentInstance
getClassLoader
in interface IInternalAccess
getClassLoader
in class jadex.kernelbase.StatelessAbstractInterpreter
Copyright © 2012. All Rights Reserved.