BPELSE Event Dispatching and Listener Framework
Purpose
To allow different parties to listen for BPELSE events, events generated from BPELSE are posted to a queue and dispatched to interested event listeners asynchronously.
BPELEvent
interface BPELEvent
{
enum EventType {BP-START, BP-COMPLETE, BP-TERMINATED, BP-SUSPEND, BP-RESUME, ACTIVITY-START, ACTIVITY-END, ACTIVITY-FAULTED, VARIABLE-CHANGED };
readonly attribute string id;
readonly attribute string engineid;
readonly attribute string bpid;
readonly attribute string processid;
readonly attribute EventType type;
readonly attribute datetime time;
}
Implementation of BPELEvent includes BPInstanceEvent, ActivityEvent, VariableEvent
interface BPInstanceEvent, : BPELEvent
{
}
interface ActivityEvent : BPELEvent
{
readonly attribute long activityid;
readonly attribute long activityXpath;
}
interface VariableEvent : BPELEvent
{
enum VariableType {Input, Output, Fault, Old, New};
readonly attribute long activityid;
readonly attribute long activityXpath;
readonly attribute map<VariableType, list<Variable>> variables;
}
interface Variable
{
enum DataType {String, Number, Boolean, Date, Complex_Type, Element, Message};
readonly attribute DataType type;
readonly attribute long scopeid;
readonly attribute long varid;
readonly attribute long varname;
readonly attribute string value;
readonly attribute boolean isFault;
}
ActivityUnit creates the event and posts to the Event queue (BPELProcessManager.postEvent(Event))
Event Queue
The EventQueue is an instance of LinkedBlockingQueue
Event Dispatcher
Event Dispatcher is a thread managed by Engine as BPELSEInOutThread. It does blocking read on event queue, and dispatches the event to each event listener, which either processes or ignores the event.
Event Listener
Event listener processes the event, such as persists to the DB, sends to another component or webservice
interface EventListener : Thread
{
void processEvent (in BPELEvent event);
}
BPEL engine finds all event listeners by search from the context classloader for META-INF/services/com.sun.jbi.engine.bpel.core.bpel.event.BPELEventListener, if found, each line in the file specifies an event listener impl class. BPEL engine creates an instance of the event listener and registers it with event dispatcher
This page (revision-4) was last changed on
10-Aug-07 07:51 AM, -0700
by MeiWu.
This page was created on
02-Aug-07 08:44 AM, -0700 by MeiWu.
Back to BPELSE Event Listener