wt.workflow.engine
Class WfCustomEvent

java.lang.Object
  extended bywt.events.KeyedEvent
      extended bywt.workflow.engine.WfCustomEvent
All Implemented Interfaces:
Serializable

public class WfCustomEvent
extends KeyedEvent
implements Serializable

Workflow event that can be emitted with an arbitrary payload. The types of possible custom events are defined in a resource bundle: "WfCustomEventType."

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  String customType
           
private static String EVENT_QUERY_URL
           
private  Timestamp eventTime
           
private static Hashtable eventTypeCache
           
private static long eventTypeCacheExpiry
           
private  Hashtable nameValueMap
           
private static String RESOURCE
           
private  WfEngineService service
           
private static String TYPE_CLASSNAME
           
 
Fields inherited from class wt.events.KeyedEvent
 
Constructor Summary
WfCustomEvent(WfEngineService svc, String event_type, Hashtable value_map)
          Custom event constructor.
WfCustomEvent(WfEngineService svc, String event_type, Object target, Hashtable value_map)
          Custom event constructor.
 
Method Summary
static void checkCustomType(String event_type)
          Thrwos an exception if event type passed as argument is not valid.
private  void customTypeValidate(String a_CustomType)
           
static String generateEventKey(String event_type)
          Generates the event key given the type of the custom event, passed as a String.
 String getCustomType()
          Gets the value of the attribute: customType; Type of the event.
static Enumeration getCustomTypes()
          Returns an enumeration contaiining all event types.
 Timestamp getEventTime()
          Gets the value of the attribute: eventTime; Time the event occurred.
 Enumeration getNames()
          Returns the names of the attributes stored in the event's table.
protected  Hashtable getNameValueMap()
          Gets the value of the attribute: nameValueMap; Event payload.
 WfEngineService getService()
          Gets the value of the attribute: service; Service that originated the event.
 Object getValue(String attr_name)
          Gets the value corresponding to an attribute.
 void setCustomType(String a_CustomType)
          Sets the value of the attribute: customType; Type of the event.
 void setEventTime(Timestamp a_EventTime)
          Sets the value of the attribute: eventTime; Time the event occurred.
protected  void setNameValueMap(Hashtable a_NameValueMap)
          Sets the value of the attribute: nameValueMap; Event payload.
 void setService(WfEngineService a_Service)
          Sets the value of the attribute: service; Service that originated the event.
 
Methods inherited from class wt.events.KeyedEvent
generateEventKey, generateEventKey, getConceptualClassname, getEventKey, getEventTarget, getEventType, toMultiObjectEvent, toSingleObjectEvents, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

customType

private String customType

service

private WfEngineService service

eventTime

private Timestamp eventTime

nameValueMap

private Hashtable nameValueMap

TYPE_CLASSNAME

private static final String TYPE_CLASSNAME
See Also:
Constant Field Values

EVENT_QUERY_URL

private static String EVENT_QUERY_URL

eventTypeCache

private static Hashtable eventTypeCache

eventTypeCacheExpiry

private static long eventTypeCacheExpiry
Constructor Detail

WfCustomEvent

public WfCustomEvent(WfEngineService svc,
                     String event_type,
                     Hashtable value_map)
              throws WTException
Custom event constructor. Takes the service, the type and the payload as argument. If the type is not defined in an exception is thrown.

Supported API: false

Parameters:
svc -
event_type -
value_map -
Throws:
WTException

WfCustomEvent

public WfCustomEvent(WfEngineService svc,
                     String event_type,
                     Object target,
                     Hashtable value_map)
              throws WTException
Custom event constructor. Takes the service, the type, the target object and the payload as argument. If the type is not an exception is thrown.

Supported API: false

Parameters:
svc -
event_type -
target -
value_map -
Throws:
WTException
Method Detail

getCustomType

public String getCustomType()
Gets the value of the attribute: customType; Type of the event. Not every String can be a type. The set of possible custom events are defined in a resource bundle: "WfCustomEventType." They correspond to the keys of the bundle.

Supported API: false

Returns:
String

setCustomType

public void setCustomType(String a_CustomType)
                   throws WTPropertyVetoException
Sets the value of the attribute: customType; Type of the event. Not every String can be a type. The set of possible custom events are defined in a resource bundle: "WfCustomEventType." They correspond to the keys of the bundle.

Supported API: false

Parameters:
a_CustomType -
Throws:
WTPropertyVetoException

customTypeValidate

private void customTypeValidate(String a_CustomType)
                         throws WTPropertyVetoException
Parameters:
a_CustomType -
Throws:
WTPropertyVetoException

getService

public WfEngineService getService()
Gets the value of the attribute: service; Service that originated the event.

Supported API: false

Returns:
WfEngineService

setService

public void setService(WfEngineService a_Service)
                throws WTPropertyVetoException
Sets the value of the attribute: service; Service that originated the event.

Supported API: false

Parameters:
a_Service -
Throws:
WTPropertyVetoException

getEventTime

public Timestamp getEventTime()
Gets the value of the attribute: eventTime; Time the event occurred.

Supported API: false

Returns:
Timestamp

setEventTime

public void setEventTime(Timestamp a_EventTime)
                  throws WTPropertyVetoException
Sets the value of the attribute: eventTime; Time the event occurred.

Supported API: false

Parameters:
a_EventTime -
Throws:
WTPropertyVetoException

getNameValueMap

protected Hashtable getNameValueMap()
Gets the value of the attribute: nameValueMap; Event payload. Values can be retrieved using the 'getValue' method, passing the attribute name.

Supported API: false

Returns:
Hashtable

setNameValueMap

protected void setNameValueMap(Hashtable a_NameValueMap)
                        throws WTPropertyVetoException
Sets the value of the attribute: nameValueMap; Event payload. Values can be retrieved using the 'getValue' method, passing the attribute name.

Supported API: false

Parameters:
a_NameValueMap -
Throws:
WTPropertyVetoException

generateEventKey

public static String generateEventKey(String event_type)
                               throws WTException
Generates the event key given the type of the custom event, passed as a String. An exception is thrown if the event_type is not a key in the WfCustomEventType resource bundle.

Supported API: false

Parameters:
event_type -
Returns:
String
Throws:
WTException

checkCustomType

public static void checkCustomType(String event_type)
                            throws WTException
Thrwos an exception if event type passed as argument is not valid. The list of valid events is contained in WfCustomEventType resource bundle.

Supported API: false

Parameters:
event_type -
Throws:
WTException

getCustomTypes

public static Enumeration getCustomTypes()
Returns an enumeration contaiining all event types.

Supported API: false

Returns:
Enumeration

getValue

public Object getValue(String attr_name)
Gets the value corresponding to an attribute. Returns 'null' if there is no value associated with attribute name.

Supported API: false

Parameters:
attr_name -
Returns:
Object

getNames

public Enumeration getNames()
Returns the names of the attributes stored in the event's table.