Question & Answer
Question
Sterling Order Management 9.3 fix pack 13 and 9.4 fix pack 5 provide an ability to publish order audit data to an external systems. Publishing of the order audit happens asynchronously, such as in parallel threads in the form of XML. A custom listener must be implemented to work upon the published order audit XML. For example, The listener could store this data into an external database. If this feature is enabled, then the order audits are no longer stored in the underlying Oracle or DB2 databases. To enable this feature, the following properties are set in the customer_overrides.properties
yfs.publish.mode=OrderAudit yfs.order.audit.publish.listener=
Answer
Publishing of order audit data to any external system of choice IDataPublishListener contains only one method called "onPublish". This needs to be implemented by custom class. This interface has Java
documentation in it which can be accessed by developers in nay IDE tool like eclipse. This method will receive the XML data for all order audits created in a transaction like API call or service call etc.
Note: Since this publish happens asynchronously (without blocking ongoing Java thread) after commit of transaction, any errors happening in custom implementation need to be handled by the custom
implementation.
sample code is as below
------------------------------
public class MyOrderAuditPublishListener implements
IDataPublishListener {
/* order audit xml received for one transaction.
*<OrderAudits>
* <OrderAudit>
* <OrderAuditLevels>
* <OrderAuditLevel>
* <OrderAuditDetail/>
* </OrderAuditLevel>
* </OrderAuditLevels>
* </OrderAudit>
*</OrderAudits>
*/
public void onPublish(YFCDocument publishedData) {
try {
// custom code to send/insert data into external system.
} catch (Exception e) {
// exception handling
}
}
}
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg22000181