org.obe.spi.event
Class WorkflowEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byorg.obe.spi.event.ApplicationEvent
          extended byorg.obe.spi.event.WorkflowEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ActivityInstanceEvent, AttributeInstanceEvent, PackageEvent, ProcessDefinitionEvent, ProcessInstanceEvent, TransitionEvent, WorkItemEvent

public abstract class WorkflowEvent
extends ApplicationEvent

Base class for workflow notification events. Sub-classes must follow a specific design pattern: they must supply a single, public constructor that takes the following arguments: (Object source, int id, WorkflowEventBroker [, AbstractWFElement definition]). The source and definition arguments are sub-classes of Object and AbstractWFElement respectively. The definition argument is optional. The event ids should be declared by the event subclass, and must be contiguous and 0-based.

Author:
Adrian Price
See Also:
AbstractListenerSupport, Serialized Form

Field Summary
protected  WorkflowEventBroker _broker
           
protected  int _id
           
protected  long _timestamp
           
 
Fields inherited from class org.obe.spi.event.ApplicationEvent
ACTION, CONTENT_TYPE, EMPTY_KEYS, EMPTY_MAP, EXCEPTION_EVENT, SCHEMA, TIMEOUT_EVENT
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected WorkflowEvent(java.lang.Object source, int id, java.lang.Class sourceClass, java.lang.String eventType, java.io.Serializable key, WorkflowEventBroker broker)
          Construct a new WorkflowEvent.
 
Method Summary
 int getId()
          Returns the event id, as defined in subclasses.
 long getTimestamp()
          Returns the system time at which the event occurred.
abstract  WMAEventCode getWMAEventCode()
          Returns the WfMC Interface 5 audit event code (if defined).
 
Methods inherited from class org.obe.spi.event.ApplicationEvent
getAction, getApplication, getContentType, getEventType, getExpiry, getKeys, getProperties, getProperty, getSchema, setApplication, setEventType, setExpiry, setKeys, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_broker

protected transient WorkflowEventBroker _broker

_timestamp

protected final long _timestamp

_id

protected final int _id
Constructor Detail

WorkflowEvent

protected WorkflowEvent(java.lang.Object source,
                        int id,
                        java.lang.Class sourceClass,
                        java.lang.String eventType,
                        java.io.Serializable key,
                        WorkflowEventBroker broker)
Construct a new WorkflowEvent.

Parameters:
source - The entity that is the source of this event.
id - The event ID code. N.B. Event codes are defined by sub-classes; they must be contiguous and 0-based.
sourceClass - The SPI interface implemented by the source object.
eventType - The event name. This has the form <event-class>
key - The primary key of the source entity.
See Also:
AbstractListenerSupport.AbstractListenerSupport(org.obe.spi.service.WorkflowEventBroker, java.lang.Class, java.lang.Class, java.lang.String[])
Method Detail

getId

public final int getId()
Returns the event id, as defined in subclasses.

Returns:
The event id.

getTimestamp

public long getTimestamp()
Returns the system time at which the event occurred.

Returns:
System time in milliseconds.

getWMAEventCode

public abstract WMAEventCode getWMAEventCode()
Returns the WfMC Interface 5 audit event code (if defined).

Returns:
Audit event code.


SourceForge.net Logo OBE-1.0 Copyright (c) 2002-2006 Adrian Price. All Rights Reserved.