public class BpmnPlanBodyInstance extends BpmnInterpreter
Modifier and Type | Field and Description |
---|---|
static Map |
PLAN_ACTIVITY_HANDLERS
The activity execution handlers (activity type -> handler).
|
ALL, DEFAULT_ACTIVITY_HANDLERS, DEFAULT_STEP_HANDLERS, TYPE_ACTIVITY, TYPE_THREAD
Constructor and Description |
---|
BpmnPlanBodyInstance(jadex.bpmn.model.MBpmnModel model,
BDIInterpreter interpreter,
Object rcapa,
Object rplan)
Create a new BPMN process instance using default handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addPlanListener(IPlanListener listener)
Add a plan listener.
|
void |
addTimer(ProcessThread thread,
long duration)
Add a timer for a thread.
|
IExpression |
createExpression(String expression)
Create a precompiled expression.
|
IExpression |
createExpression(String expression,
String[] paramnames,
Class[] paramtypes)
Create a precompiled expression.
|
IGoal |
createGoal(String type)
Create a goal from a template goal.
|
IInternalEvent |
createInternalEvent(String type)
Create a new intenal event.
|
IMessageEvent |
createMessageEvent(String type)
Create a new message event.
|
IServiceContainer |
createServiceContainer()
Service container is set from the outside.
|
void |
dispatchInternalEvent(IInternalEvent event)
Dispatch an internal event.
|
void |
dispatchSubgoal(IGoal subgoal)
Dispatch a new subgoal.
|
void |
dispatchTopLevelGoal(IGoal goal)
Dispatch a new top-level goal.
|
void |
endAtomic()
End an atomic transaction.
|
void |
fail()
Let a plan fail.
|
void |
fail(String message,
Throwable cause)
Let a plan fail.
|
void |
fail(Throwable cause)
Let a plan fail.
|
IComponentIdentifier |
getAgentIdentifier()
Get the agent identifier.
|
String |
getAgentName()
Get the agent name.
|
IBeliefbase |
getBeliefbase()
Get the belief base.
|
IClockService |
getClock()
Get the clock.
|
IElement |
getDispatchedElement()
Get the dispatched element, i.e.
|
IEventbase |
getEventbase()
Get the event base.
|
String |
getEventParent()
Get the event parent.
|
Exception |
getException()
Get the uncatched exception that occurred in the body (if any).
|
IExpression |
getExpression(String name)
Get an instance of a predefined expression.
|
IExpressionbase |
getExpressionbase()
Get the expression base.
|
IGoalbase |
getGoalbase()
Get the goal base.
|
BDIInterpreter |
getInterpreter()
Get the state.
|
String |
getLastState()
Get the last plan lifecycle state.
|
Logger |
getLogger()
Get the logger.
|
IParameter |
getParameter(String name)
Get a parameter.
|
IParameter[] |
getParameters()
Get all parameters.
|
IParameterSet |
getParameterSet(String name)
Get a parameter.
|
IParameterSet[] |
getParameterSets()
Get all parameter sets.
|
IPlanbase |
getPlanbase()
Get the plan base.
|
IElement |
getReason()
Get the reason, why the plan gets executed.
|
Object |
getRPlan()
Get the plan instance info.
|
ICapability |
getScope()
Get the scope.
|
IServiceProvider |
getServiceProvider()
Get the service provider.
|
jadex.rules.state.IOAVState |
getState()
Get the state.
|
long |
getTime()
Get the current time.
|
long |
getTimeout()
Get the current timeout of the process, i.e.
|
Object |
getWaitAbstraction()
Get the cumulated wait abstraction for all threads.
|
IWaitqueue |
getWaitqueue()
Get the waitqueue.
|
boolean |
hasParameter(String name)
Has the element a parameter element.
|
boolean |
hasParameterSet(String name)
Has the element a parameter set element.
|
boolean |
isExternalThread()
Delegate synchronization to agent.
|
void |
killAgent()
Kill this agent.
|
void |
notify(jadex.bpmn.model.MActivity activity,
ProcessThread thread,
Object event)
Delegate synchronization to agent.
|
void |
removePlanListener(IPlanListener listener)
Remove a plan listener.
|
void |
removeTimer(ProcessThread thread)
Remove a timer for a thread.
|
IFuture |
scheduleStep(IComponentStep step)
Schedule a step of the agent.
|
IFuture |
sendMessage(IMessageEvent me)
Send a message after some delay.
|
IFuture |
sendMessage(IMessageEvent me,
byte[] codecids)
Send a message after some delay.
|
void |
setLastState(String state)
Set the plan lifecycle state.
|
void |
startAtomic()
Start an atomic transaction.
|
void |
updateWaitingThreads()
Update the waiting threads according to the wakeup reason (dispatched element).
|
afterBlock, beforeBlock, createActivityEvent, createProcessThreadInfo, createReply, createReply, createThreadEvent, executeStep, executeStep, getActivityHandler, getClassLoader, getContextVariable, getCurrentStateEvents, getFetcher, getInternalAccess, getModelElement, getPersistableState, getTopLevelThread, getVariables, hasContextVariable, init, isAtBreakpoint, isFinished, isFinished, isReady, isReady, messageArrived, setContextVariable, setContextVariable, startBehavior, startEndSteps, step, streamArrived
addArgument, addDefaultResult, addExtension, addProperty, checkAllowedThread, getArguments, getBindings, getComponentAdapter, getConfiguration, getExtension, getExtensions, getExternalAccess, getModel, getMonitoringServiceGetter, getParentAccess, getProperties, getProvidedServiceInfos, getPublishEmitLevelMonitoring, getPublishEmitLevelSubscriptions, getResults, getServiceContainer, getServiceRegistry, hasEventTargets, invalidateAccess, isCopy, isRealtime, publishLocalEvent, setResultValue, subscribeToEvents, subscribeToResults, terminateResultSubscribers
addService, cleanupComponent, componentCreated, componentDestroyed, createChild, createComponent, createInternalService, createResultListener, createResultListener, getArguments, getChildren, getComponentDescription, getComponentFilename, getComponentIdentifier, getLocalType, getName, getName, getNumber, getParent, getProperty, getRawService, getRawService, getRawServices, getServicePrefix, initArguments, initComponents, initExtension, initExtensions, initFutureProperties, initProvidedServices, initRequiredServices, isComponentThread, 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, getModel, getParentAccess, getResults, getServiceContainer, hasEventTargets, isComponentThread, killComponent, publishEvent, setResultValue, subscribeToEvents, waitForDelay, waitForDelay, waitForDelay, waitForDelay
public static final Map PLAN_ACTIVITY_HANDLERS
public BpmnPlanBodyInstance(jadex.bpmn.model.MBpmnModel model, BDIInterpreter interpreter, Object rcapa, Object rplan)
model
- The BMPN process model.public String getLastState()
public void setLastState(String state)
state
- The plan lifecycle state.public void addTimer(ProcessThread thread, long duration)
thread
- The process thread that should wait.duration
- The duration to wait for.public void removeTimer(ProcessThread thread)
thread
- The process thread that should wait.duration
- The duration to wait for.public void updateWaitingThreads()
public long getTimeout()
public Object getWaitAbstraction()
public void fail()
public void fail(Throwable cause)
cause
- The cause.public void fail(String message, Throwable cause)
message
- The message.cause
- The cause.public ICapability getScope()
public IElement getReason()
public IElement getDispatchedElement()
public Logger getLogger()
getLogger
in interface IInternalAccess
getLogger
in class jadex.kernelbase.StatelessAbstractInterpreter
public void startAtomic()
endAtomic()
public void endAtomic()
startAtomic()
public void dispatchSubgoal(IGoal subgoal)
subgoal
- The new subgoal.
Note: plan step is interrupted after call.public IWaitqueue getWaitqueue()
public String getAgentName()
public IComponentIdentifier getAgentIdentifier()
public Exception getException()
public void killAgent()
public IBeliefbase getBeliefbase()
public IGoalbase getGoalbase()
public IPlanbase getPlanbase()
public IEventbase getEventbase()
public IExpressionbase getExpressionbase()
public IClockService getClock()
public long getTime()
System.currentTimeMillis()
, i.e.,
the value of milliseconds passed since 0:00 'o clock, January 1st, 1970, UTC.
For custom simulation clocks, arbitrary representations can be used.public void dispatchTopLevelGoal(IGoal goal)
goal
- The new goal.
Note: plan step is interrupted after call.public IGoal createGoal(String type)
type
- The template goal name as specified in the ADF.public IFuture sendMessage(IMessageEvent me)
me
- The message event.public IFuture sendMessage(IMessageEvent me, byte[] codecids)
me
- The message event.public void dispatchInternalEvent(IInternalEvent event)
event
- The event.
Note: plan step is interrupted after call.public IMessageEvent createMessageEvent(String type)
public IInternalEvent createInternalEvent(String type)
public IExpression getExpression(String name)
name
- The name of an expression defined in the ADF.public IExpression createExpression(String expression)
expression
- The expression string.public IExpression createExpression(String expression, String[] paramnames, Class[] paramtypes)
expression
- The expression string.public IParameter[] getParameters()
public IParameterSet[] getParameterSets()
public IParameter getParameter(String name)
name
- The name.public IParameterSet getParameterSet(String name)
name
- The name.public boolean hasParameter(String name)
name
- The name.public boolean hasParameterSet(String name)
name
- The name.public jadex.rules.state.IOAVState getState()
public BDIInterpreter getInterpreter()
public String getEventParent()
public Object getRPlan()
public void addPlanListener(IPlanListener listener)
listener
- The plan listener.public void removePlanListener(IPlanListener listener)
listener
- The plan listener.public void notify(jadex.bpmn.model.MActivity activity, ProcessThread thread, Object event)
notify
in class BpmnInterpreter
activity
- The timing event activity.instance
- The process instance.thread
- The process thread.event
- The event that has occurred, if any.public boolean isExternalThread()
isExternalThread
in interface IComponentInstance
isExternalThread
in class jadex.kernelbase.StatelessAbstractInterpreter
public IFuture scheduleStep(IComponentStep step)
scheduleStep
in class BpmnInterpreter
step
- Code to be executed as a step of the agent.public IServiceProvider getServiceProvider()
getServiceProvider
in class jadex.kernelbase.StatelessAbstractInterpreter
public IServiceContainer createServiceContainer()
createServiceContainer
in class jadex.kernelbase.AbstractInterpreter
Copyright © 2015. All Rights Reserved.