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))
The EventQueue is an instance of LinkedBlockingQueue
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.
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