com.ptc.windchill.esi.evt
Class ESIEvent

java.lang.Object
  extended bycom.ptc.windchill.esi.evt.ESIEvent

public class ESIEvent
extends Object

A container for information necessary for ESI event notifications. This class is intentionally not thread-safe.

Supported API: true

Extendable: true


Field Summary
private  String action
           
private static String CLASSNAME
           
protected static String HTML_SPACE
           
protected static String NULL_STRING
           
private  Releasable object
           
private static String RESOURCE
           
private  ESITargetUtility targetUtility
           
private  ESITransaction txn
           
private  String userName
           
private  WTObject waiter
           
 
Constructor Summary
ESIEvent()
           
 
Method Summary
private  void actionValidate(String a_Action)
           
private  ESITransaction createTransaction()
           
 String getAction()
          Gets the value of the attribute: action; Describes the action to be passed to the JMS task.
 Releasable getObject()
          Gets the object for the association that plays role: object.
 String getObjectID()
          Returns the obid from the contained object

Supported API: false
 Collection getTargets()
          Returns a collection of ESITargetAssociation objects related to the WTObject in the object attribute.
 String getTransactionNumber()
          Returns the number from the ESITransaction in the txn attribute.
protected  ESITransaction getTxn()
          Gets the value of the attribute: txn; The ESI transaction that is created when this event is generated.
 String getUserName()
          Gets the value of the attribute: userName; The ID of the user responsible for the event.
 WTObject getWaiter()
          Gets the object for the association that plays role: waiter.
 String getWaitingObjectID()
          If the waiter attribute is not null, returns the id of that object.
private  void objectValidate(Releasable a_Object)
           
 void setAction(String a_Action)
          Sets the value of the attribute: action; Describes the action to be passed to the JMS task.
 void setObject(Releasable a_Object)
          Sets the object for the association that plays role: object.
 void setUserName(String a_UserName)
          Sets the value of the attribute: userName; The ID of the user responsible for the event.
 void setWaiter(WTObject a_Waiter)
          Sets the object for the association that plays role: waiter.
private  void userNameValidate(String a_UserName)
           
 void validate()
          Insures that the ESIEvent object has the correct state and is ready to be published.
private  void waiterValidate(WTObject a_Waiter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

action

private String action

userName

private String userName

txn

private ESITransaction txn

waiter

private WTObject waiter

object

private Releasable object

NULL_STRING

protected static final String NULL_STRING
See Also:
Constant Field Values

HTML_SPACE

protected static final String HTML_SPACE
See Also:
Constant Field Values

targetUtility

private ESITargetUtility targetUtility
Constructor Detail

ESIEvent

public ESIEvent()
Method Detail

getAction

public String getAction()
Gets the value of the attribute: action; Describes the action to be passed to the JMS task.

Supported API: false

Returns:
String

setAction

public void setAction(String a_Action)
               throws WTPropertyVetoException
Sets the value of the attribute: action; Describes the action to be passed to the JMS task.

Supported API: false

Parameters:
a_Action -
Throws:
WTPropertyVetoException

actionValidate

private void actionValidate(String a_Action)
                     throws WTPropertyVetoException
Parameters:
a_Action -
Throws:
WTPropertyVetoException

getUserName

public String getUserName()
Gets the value of the attribute: userName; The ID of the user responsible for the event.

Supported API: false

Returns:
String

setUserName

public void setUserName(String a_UserName)
                 throws WTPropertyVetoException
Sets the value of the attribute: userName; The ID of the user responsible for the event.

Supported API: false

Parameters:
a_UserName -
Throws:
WTPropertyVetoException

userNameValidate

private void userNameValidate(String a_UserName)
                       throws WTPropertyVetoException
Parameters:
a_UserName -
Throws:
WTPropertyVetoException

getTxn

protected ESITransaction getTxn()
Gets the value of the attribute: txn; The ESI transaction that is created when this event is generated. The getter does lazy initialization, creating and saving the ESITransaction object if necessary.

Supported API: true

Returns:
ESITransaction

getWaiter

public WTObject getWaiter()
Gets the object for the association that plays role: waiter.

Supported API: false

Returns:
WTObject

setWaiter

public void setWaiter(WTObject a_Waiter)
               throws WTPropertyVetoException
Sets the object for the association that plays role: waiter.

Supported API: false

Parameters:
a_Waiter -
Throws:
WTPropertyVetoException

waiterValidate

private void waiterValidate(WTObject a_Waiter)
                     throws WTPropertyVetoException
Parameters:
a_Waiter -
Throws:
WTPropertyVetoException

getObject

public Releasable getObject()
Gets the object for the association that plays role: object.

Supported API: false

Returns:
Releasable

setObject

public void setObject(Releasable a_Object)
               throws WTPropertyVetoException
Sets the object for the association that plays role: object.

Supported API: false

Parameters:
a_Object -
Throws:
WTPropertyVetoException

objectValidate

private void objectValidate(Releasable a_Object)
                     throws WTPropertyVetoException
Parameters:
a_Object -
Throws:
WTPropertyVetoException

getTargets

public Collection getTargets()
                      throws ESIEventException
Returns a collection of ESITargetAssociation objects related to the WTObject in the object attribute. If the attribute is a WTChangeOrder2, or a WTChangeActivity2, get the targets from the changeable objects associated to the change order or change activity.

Supported API: false

Returns:
Collection
Throws:
ESIEventException

validate

public void validate()
              throws ESIEventException
Insures that the ESIEvent object has the correct state and is ready to be published. Obtains an ESIEventValidator implementation from the ESIEventValidatorFactory. Calls the validate() method on the ESIEventValidator. Then calls the private methods objectValidate() and actionValidate().

Supported API: true

Throws:
ESIEventException

getObjectID

public String getObjectID()
Returns the obid from the contained object

Supported API: false

Returns:
String

getWaitingObjectID

public String getWaitingObjectID()
If the waiter attribute is not null, returns the id of that object.

Supported API: false

Returns:
String

getTransactionNumber

public String getTransactionNumber()
                            throws WTException
Returns the number from the ESITransaction in the txn attribute. If the attribute is null, creates a new ESITranaction and saves it in the database before returning the result.

Supported API: false

Returns:
String
Throws:
WTException

createTransaction

private ESITransaction createTransaction()
                                  throws WTException
Throws:
WTException