Example code - EnterWorks_Process_Exchange_(EPX) - 10.6

EnterWorks EPX Programmers Reference

Product type
Software
Portfolio
Verify
Product family
EnterWorks
Product
Precisely EnterWorks > EnterWorks Process Exchange (EPX)
Version
10.6
Language
English
Product name
Precisely EnterWorks
Title
EnterWorks EPX Programmers Reference
Topic type
Programming Reference
Reference
First publish date
2007

In this example code, the method simply processes the EventNotification object for the conditions where it contains a collection of nested EventNotification objects, and prints some detail about each EventNotification object.

public void onEvent(EventNotification eventNotification)

throws EventException

{

// output a message that an event was received

String vargs[] = { eventNotification.toStringShort() };

System.out.println(getMessage("event.received",vargs));

// output some details about the event

switch (eventNotification.getSubject() )

{

// generic transaction subject events can contain a

// collection of event notifications related

// to a single transaction

case EventRegistration.SUBJECT_GENERIC_TRANSACTION:

if (

eventNotification.getNestedEventNotifications()

== null)

showEventNotificationDetail(eventNotification);

else

{

Iterator eventIter =

eventNotification.

getNestedEventNotifications().iterator();

while ( eventIter.hasNext() )

{

EventNotification nestedEvent =

(EventNotification) eventIter.next();

showEventNotificationDetail(nestedEvent);

}

}

break;

case EventRegistration.SUBJECT_SERVER: showEventNotificationDetail(eventNotification);

break;

}

}

private void showEventNotificationDetail(

EventNotification eventNotification)

{

BaseValueObject valueObject =

eventNotification.getValueObject();

String vargs[] = {EventRegistration.getAspectName (

eventNotification.getAspect()),

valueObject.getName(),

valueObject.toStringDebug() };

System.out.println(getMessage("event.detail",vargs));

}

)