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 install_dir/properties/customer_overrides.properties file.