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<String,IActivityHandler> |
DEFAULT_ACTIVITY_HANDLERS
The activity execution handlers (activity type -> handler).
|
static Map<String,IStepHandler> |
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,
jadex.bpmn.model.MBpmnModel model,
Map<String,Object> arguments,
String config,
IExternalAccess parent,
Map<String,IActivityHandler> activityhandlers,
Map<String,IStepHandler> stephandlers,
IValueFetcher fetcher,
IComponentManagementService cms,
IClockService cs,
IMessageService ms,
IServiceContainer container)
Create a new bpmn process.
|
BpmnInterpreter(IComponentDescription desc,
IComponentAdapterFactory factory,
jadex.bpmn.model.MBpmnModel model,
Map<String,Object> arguments,
String config,
IExternalAccess parent,
Map<String,IActivityHandler> activityhandlers,
Map<String,IStepHandler> 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 |
---|---|
void |
afterBlock()
Called after unblocking the component thread.
|
void |
beforeBlock()
Called before blocking the component thread.
|
IMonitoringEvent |
createActivityEvent(String type,
ProcessThread thread,
jadex.bpmn.model.MActivity activity)
Create an activity event (start, end).
|
ProcessThreadInfo |
createProcessThreadInfo(ProcessThread thread) |
Map<String,Object> |
createReply(IMessageAdapter msg)
Create a reply to this message event.
|
Map<String,Object> |
createReply(Map<String,Object> msg,
MessageType mt)
Create a reply to this message event.
|
IMonitoringEvent |
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(jadex.bpmn.model.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.
|
List<IMonitoringEvent> |
getCurrentStateEvents()
Get the current state as monitoring events.
|
IValueFetcher |
getFetcher()
Get the value fetcher.
|
IInternalAccess |
getInternalAccess()
Get the internal access.
|
jadex.bpmn.model.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(jadex.bpmn.model.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(jadex.bpmn.model.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, addDefaultResult, addExtension, addProperty, checkAllowedThread, createServiceContainer, getArguments, getBindings, getComponentAdapter, getConfiguration, getExtension, getExtensions, getExternalAccess, getModel, getMonitoringServiceGetter, getParentAccess, getProperties, getPublishEmitLevelMonitoring, getPublishEmitLevelSubscriptions, getResults, getServiceContainer, hasEventTargets, isCopy, isRealtime, publishLocalEvent, setResultValue, subscribeToEvents
addService, cleanupComponent, componentCreated, componentDestroyed, createChild, createComponent, createInternalService, createResultListener, createResultListener, getArguments, getChildren, getComponentDescription, getComponentFilename, getComponentIdentifier, getLocalType, getLogger, getName, getName, getNumber, getParent, getProperty, getRawService, getRawService, getRawServices, getServicePrefix, getServiceProvider, init, initArguments, initComponents, initExtension, initExtensions, initFutureProperties, initProvidedServices, initRequiredServices, isComponentThread, isExternalThread, killComponent, publishEvent, publishEvent, startInitialSteps, startServiceContainer, terminateExtensions, terminateServiceContainer, toString, waitForDelay, waitForDelay, waitForDelay, waitForDelay
addNFProperty, getNFAllPropertyNames, getNFPropertyMetaInfo, getNFPropertyMetaInfos, getNFPropertyNames, getNFPropertyValue, getNFPropertyValue, removeNFProperty, setParent, shutdownNFPropertyProvider
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
createResultListener, createResultListener, getArguments, getComponentDescription, getComponentIdentifier, getConfiguration, getExternalAccess, getLogger, getModel, getParentAccess, getResults, getServiceContainer, hasEventTargets, isComponentThread, killComponent, publishEvent, setResultValue, subscribeToEvents, waitForDelay, waitForDelay, waitForDelay, waitForDelay
public static final String TYPE_ACTIVITY
public static final String TYPE_THREAD
public static final Map<String,IActivityHandler> DEFAULT_ACTIVITY_HANDLERS
public static final Map<String,IStepHandler> DEFAULT_STEP_HANDLERS
public static final String ALL
public BpmnInterpreter(IComponentAdapter adapter, jadex.bpmn.model.MBpmnModel model, Map<String,Object> arguments, String config, IExternalAccess parent, Map<String,IActivityHandler> activityhandlers, Map<String,IStepHandler> stephandlers, IValueFetcher fetcher, IComponentManagementService cms, IClockService cs, IMessageService ms, IServiceContainer container)
adapter
- The adapter.public BpmnInterpreter(IComponentDescription desc, IComponentAdapterFactory factory, jadex.bpmn.model.MBpmnModel model, Map<String,Object> arguments, String config, IExternalAccess parent, Map<String,IActivityHandler> activityhandlers, Map<String,IStepHandler> 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 beforeBlock()
beforeBlock
in interface IComponentInstance
public void afterBlock()
afterBlock
in interface IComponentInstance
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 jadex.bpmn.model.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(jadex.bpmn.model.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(jadex.bpmn.model.MActivity activity)
actvity
- The activity.public void step(jadex.bpmn.model.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<String,Object> createReply(IMessageAdapter msg)
msgeventtype
- The message event type.public Map<String,Object> createReply(Map<String,Object> msg, MessageType mt)
msgeventtype
- The message event type.public IMonitoringEvent createThreadEvent(String type, ProcessThread thread)
public IMonitoringEvent createActivityEvent(String type, ProcessThread thread, jadex.bpmn.model.MActivity activity)
public ClassLoader getClassLoader()
getClassLoader
in interface IComponentInstance
getClassLoader
in interface IInternalAccess
getClassLoader
in class jadex.kernelbase.StatelessAbstractInterpreter
public List<IMonitoringEvent> getCurrentStateEvents()
getCurrentStateEvents
in class jadex.kernelbase.StatelessAbstractInterpreter
Copyright © 2013. All Rights Reserved.