org.eclipse.stardust.engine.core.spi.extensions.runtime
Class Event

java.lang.Object
  extended by org.eclipse.stardust.engine.core.spi.extensions.runtime.Event

public class Event
extends Object

Representation of an event. Indicates the event source and allows for controlled state changes of the event source. This class is not intended to be subclassed by third parties.

Version:
$Revision$
Author:
ubirkemeyer

Field Summary
static int ACTIVITY_INSTANCE
          Indicates the event source to be an activity instance.
static int ENGINE_EVENT
          Indicates an engine internal, push-type event.
static int OID_UNDEFINED
          Used to mark field handlerOID or handlerModelElementOID as undefined
static int PROCESS_INSTANCE
          Indicates the event source to be a process instance.
static int PULL_EVENT
          Indicates an arbitrary, pull-type event.
static int PUSH_EVENT
          Indicates an arbitrary, push-type event.
 
Constructor Summary
Event(int type, long objectOID, long handlerRuntimeOID, long handlerModelElementOID, int emitterType)
           
 
Method Summary
 Object getAttribute(String name)
          Gets an event specific attribute.
 Map getAttributes()
          Gets all event specific attributes.
 int getEmitterType()
          Gets the type of the event source.
 long getHandlerModelElementOID()
          Gets the model element OID of the event handler this event is targeting.
 long getHandlerOID()
          Gets the runtime OID of the event handler this event is targeting.
 ActivityInstanceState getIntendedState()
          Gets the intended state of activity event sources, allowing for safe state changes.
 long getObjectOID()
          Gets the runtime OID of the event source.
 int getType()
          Gets the event type.
 void setAttribute(String name, Object value)
          Sets an event specific attribute.
 void setAttributes(Map attributes)
          Sets event specific attributes.
 void setHandlerModelElementOID(long handlerModelElementOID)
          Sets the model element OID of the event handler this event is targeting.
 void setHandlerOID(long handlerOID)
          Sets the runtime OID of the event handler this event is targeting.
 void setIntendedState(ActivityInstanceState state)
          Sets the intended target state of activity event sources, allowing event actions to trigger safe state changes.
 String toString()
          Produces a human readable representation of this event.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OID_UNDEFINED

public static final int OID_UNDEFINED
Used to mark field handlerOID or handlerModelElementOID as undefined

See Also:
Constant Field Values

ACTIVITY_INSTANCE

public static final int ACTIVITY_INSTANCE
Indicates the event source to be an activity instance.

See Also:
Constant Field Values

PROCESS_INSTANCE

public static final int PROCESS_INSTANCE
Indicates the event source to be a process instance.

See Also:
Constant Field Values

ENGINE_EVENT

public static final int ENGINE_EVENT
Indicates an engine internal, push-type event.

See Also:
Constant Field Values

PULL_EVENT

public static final int PULL_EVENT
Indicates an arbitrary, pull-type event. Usually generated by some polling mechanism.

See Also:
Constant Field Values

PUSH_EVENT

public static final int PUSH_EVENT
Indicates an arbitrary, push-type event. Usually generated by some external mechanism.

See Also:
Constant Field Values
Constructor Detail

Event

public Event(int type,
             long objectOID,
             long handlerRuntimeOID,
             long handlerModelElementOID,
             int emitterType)
Method Detail

setAttribute

public void setAttribute(String name,
                         Object value)
Sets an event specific attribute.

Parameters:
name - The name of the attribute to be set.
value - The actual attribute value.

setAttributes

public void setAttributes(Map attributes)
Sets event specific attributes.

Parameters:
attributes - The map containing.

getAttribute

public Object getAttribute(String name)
Gets an event specific attribute.

Parameters:
name - The name of the attribute to be retrieved.
Returns:
The value of the attribute, or null.

getAttributes

public Map getAttributes()
Gets all event specific attributes.

Returns:
The attributes

getHandlerOID

public long getHandlerOID()
Gets the runtime OID of the event handler this event is targeting.

Returns:
The current event handler runtime OID.

setHandlerOID

public void setHandlerOID(long handlerOID)
Sets the runtime OID of the event handler this event is targeting.

Parameters:
handlerOID - - the runtime OID of the event handler this event is targeting

getHandlerModelElementOID

public long getHandlerModelElementOID()
Gets the model element OID of the event handler this event is targeting.

Returns:
The current event handler model element OID.

setHandlerModelElementOID

public void setHandlerModelElementOID(long handlerModelElementOID)
Sets the model element OID of the event handler this event is targeting.

Parameters:
handlerModelElementOID - - the model element OID of the event handler this event is targeting

getObjectOID

public long getObjectOID()
Gets the runtime OID of the event source.

Returns:
The event source runtime OID.
See Also:
getEmitterType()

getType

public int getType()
Gets the event type.

Returns:
The event type.
See Also:
ENGINE_EVENT, PULL_EVENT

getEmitterType

public int getEmitterType()
Gets the type of the event source.

Returns:
The event source type.
See Also:
ACTIVITY_INSTANCE, PROCESS_INSTANCE

getIntendedState

public ActivityInstanceState getIntendedState()
Gets the intended state of activity event sources, allowing for safe state changes.

Returns:
The intended activity state.

setIntendedState

public void setIntendedState(ActivityInstanceState state)
                      throws IllegalStateChangeException
Sets the intended target state of activity event sources, allowing event actions to trigger safe state changes.

Can only be set once during event processing, usually in the final event action.

Parameters:
state - The intended target state.
Throws:
IllegalStateChangeException - if there was already another state change scheduled.

toString

public String toString()
Produces a human readable representation of this event.

Overrides:
toString in class Object
Returns:
A human readable event representation.


Copyright © 2017 Eclipse Stardust. All Rights Reserved.