com.ptc.windchill.esi.evt
Class EventEmitter

java.lang.Object
  extended by com.ptc.windchill.esi.evt.EventEmitter

public class EventEmitter
extends Object

Creates an ESI event and sends it to JMS via Info*engine.

Supported API: true

Extendable: true


Method Summary
protected  void addParam(String name, Object value)
          Adds a task parameter to the event creation task before it's executed.
protected  void addTaskParams()
          Allows subclasses to add additional parameters to the task before it's executed.
protected  Locale getLocale()
          Obtains the locale to use to publish objects.
protected  String getUserName()
          Obtains the user ID of the individual responsible for publishing objects.
protected  void invokeTask(Releasable object, String action, WTObject waitingObject, String userName, Locale locale)
          Invoke an Info*Engine task to write the ESI Event into the appropriate JMS queue.Obtains from ESI properties:the name of the taskthe name of the JMS queueJMS queue authentication informationObtains the current user from the Session Manager.Obtains the SOAP message from the SoapRequestRenderer in the renderer attribute.Passes the obtained information to the task as parametersInvokes the task

Supported API: true
 void releasePart(WTPart part, String action, WTPart waitingPart)
          Validates arguments and then: creates a new transaction creates a new event passes the event to a new EventRenderer creates the task defined in the property "com.ptc.windchill.esi.eventTask" invokes the task

Supported API: true
 void releasePart(WTPart part, String action, WTPart waitingPart, String userName, Locale locale)
          Validates arguments and then: creates a new transaction creates a new event passes the event to a new EventRenderer creates the task defined in the property "com.ptc.windchill.esi.eventTask" invokes the task

Supported API: true
 void releaseWTChangeOrder2(WTChangeOrder2 ecn, String action, WTObject waitingObject)
          Validates arguments and then: creates a new transaction creates a new event passes the event to a new EventRenderer creates the task defined in the property "com.ptc.windchill.esi.eventTask" invokes the task

Supported API: true
 void releaseWTChangeOrder2(WTChangeOrder2 ecn, String action, WTObject waitingObject, String userName, Locale locale)
          Validates arguments and then: creates a new transaction creates a new event passes the event to a new EventRenderer creates the task defined in the property "com.ptc.windchill.esi.eventTask" invokes the task

Supported API: true
protected  void validate(String className, WTObject object)
          Obtains an instance of ESIValidator and invokes the validate() method on that instance.
protected  void validateWTObject(WTObject object)
          Convenience for extenders of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

releasePart

public final void releasePart(WTPart part,
                              String action,
                              WTPart waitingPart)
                       throws WTException
Validates arguments and then:
  1. creates a new transaction
  2. creates a new event
  3. passes the event to a new EventRenderer
  4. creates the task defined in the property "com.ptc.windchill.esi.eventTask"
  5. invokes the task


Supported API: true

Parameters:
part -
action -
waitingPart - optional parameter. If not null, the id of the part is passed in the generated event
Throws:
WTException

releasePart

public final void releasePart(WTPart part,
                              String action,
                              WTPart waitingPart,
                              String userName,
                              Locale locale)
                       throws WTException
Validates arguments and then:
  1. creates a new transaction
  2. creates a new event
  3. passes the event to a new EventRenderer
  4. creates the task defined in the property "com.ptc.windchill.esi.eventTask"
  5. invokes the task


Supported API: true

Parameters:
part -
action -
waitingPart - optional parameter. If not null, the id of the part is passed in the generated event
userName - The user ID of the individual responsible for publishing the object.
locale - The locale to use for publishing the object.
Throws:
WTException

releaseWTChangeOrder2

public final void releaseWTChangeOrder2(WTChangeOrder2 ecn,
                                        String action,
                                        WTObject waitingObject)
                                 throws WTException
Validates arguments and then:
  1. creates a new transaction
  2. creates a new event
  3. passes the event to a new EventRenderer
  4. creates the task defined in the property "com.ptc.windchill.esi.eventTask"
  5. invokes the task


Supported API: true

Parameters:
ecn -
action -
waitingObject - optional parameter. If not null, the id of the WTChangeOrder2 is passed in the generated event
Throws:
WTException

releaseWTChangeOrder2

public final void releaseWTChangeOrder2(WTChangeOrder2 ecn,
                                        String action,
                                        WTObject waitingObject,
                                        String userName,
                                        Locale locale)
                                 throws WTException
Validates arguments and then:
  1. creates a new transaction
  2. creates a new event
  3. passes the event to a new EventRenderer
  4. creates the task defined in the property "com.ptc.windchill.esi.eventTask"
  5. invokes the task


Supported API: true

Parameters:
ecn -
action -
waitingObject - optional parameter. If not null, the id of the WTChangeOrder2 is passed in the generated event
userName - The user ID of the individual responsible for publishing the object.
locale - The locale to use for publishing the object.
Throws:
WTException

addTaskParams

protected void addTaskParams()
Allows subclasses to add additional parameters to the task before it's executed.

Supported API: true


addParam

protected void addParam(String name,
                        Object value)
Adds a task parameter to the event creation task before it's executed.

Supported API: true

Parameters:
name -
value -

validateWTObject

protected void validateWTObject(WTObject object)
                         throws WTException
Convenience for extenders of this class. Called by releaseWTObject(). Default behavior is to call ESIWTObjectValidator.

Supported API: true

Parameters:
object -
Throws:
WTException

validate

protected void validate(String className,
                        WTObject object)
                 throws WTException
Obtains an instance of ESIValidator and invokes the validate() method on that instance. The name of the class to instantiate is the first argument.

Supported API: true

Parameters:
className - The name of a class that implements ESIValidator.
object - The object whose state is to be validated.
Throws:
WTException

invokeTask

protected void invokeTask(Releasable object,
                          String action,
                          WTObject waitingObject,
                          String userName,
                          Locale locale)
                   throws ESIEventException
Invoke an Info*Engine task to write the ESI Event into the appropriate JMS queue.
  1. Obtains from ESI properties:
    • the name of the task
    • the name of the JMS queue
    • JMS queue authentication information
  2. Obtains the current user from the Session Manager.
  3. Obtains the SOAP message from the SoapRequestRenderer in the renderer attribute.
  4. Passes the obtained information to the task as parameters
  5. Invokes the task


Supported API: true

Parameters:
object - The object that is to be published by ESI.
action - The type of release.
waitingObject - Optional argument that indicates a workflow is waiting for a Windchill event.
userName - The user ID of the individual responsible for publishing the object.
locale - The locale to use for publishing the object.
Throws:
ESIEventException

getUserName

protected String getUserName()
                      throws ESIEventException
Obtains the user ID of the individual responsible for publishing objects.

Supported API: true

Returns:
String
Throws:
ESIEventException

getLocale

protected Locale getLocale()
                    throws ESIEventException
Obtains the locale to use to publish objects.

Supported API: true

Returns:
Locale
Throws:
ESIEventException