Using event handlers to extend standard transactions

The application raises events at specific moments in processing. It enables you to define an action to be performed when a specific event occurs.

In the application configuration, an event is defined to invoke the application's event handler. The event handler performs special processing on data published by the event before being transported to the transport services layer.

As part of the event configuration, services can be invoked. When such services are invoked, some of the events, like INVENTORY_CHANGE pass data as a map whereas the other events pass data as an XML. In the event of data being passed as a map, when the service is configured for such an event the data map is converted to an XML as follows:

<?xml version="1.0" encoding="UTF-8"?> 
<SterlingXML>
   <XML AccountNo="" AdjustmentType="ADJUSTMENT" 
       EnterpriseCode="DEFAULT" ItemID="ITEM1"
       ItemKey="2005030116023851364" ...... /> 
</SterlingXML>
Note: By default, when you raise an event that has Map data, the data map gets converted to an XML with 'SterlingXML' as the root tag. If you want to override this root tag value, you must set the yfs.sci.event.flow.roottag property value as the new root tag in the <runtime_sandbox>/properties/customer_overrides.properties file.

Configuring events

You can associate an action to a service to perform special processing required. For example, the event PUBLISH_SHIP_ADVICE could invoke the application event handler to call a custom Java™ class. The Java class can augment the publish ship advice XML. The Service Definition Framework can transport the enriched XML data to the transport services layer.