UE & Custom APIs
UE & Custom APIs
Also know as Extended APIs. Basically It’s a java class which can be used to call Sterling API or third party api as well
as to perform custom processing vis Service Defination Framework (SDF)
Write a function (method) which has two parameters of type YFSEnvironment and Document and make sure that
function returns a document.
example shows how to implement a class:
import com.yantra.yfs.japi.YFSEnvironment;
import org.w3c.dom.Document;
public class Bar {
public Bar () {
}
public Document menthod-name(YFSEnvironment env, Document doc)
{
//write your implementation code here
}
}
Place the class is in the CLASSPATH of the Service Definition Framework.
In order for custom APIs to access custom values, the API should implement the YIFCustomApi interface
Extended API can be the first node after start node only in case of synchronous service.
USER EXIT
UE are created to plugin custom logic in Sterling. These are basically java interfaces which can be implemented
for creating custom logic. They are configured with transactions so that they can be invoked to perform the
custom logic during runtime. There are pre defined list of User Exits and we cannot add or delete UE.
‘Can Attach Service' =’Y’. User exits that take XML input and return XML output are service enabled. Instead of
writing java implementation we can attach service using service bulder.
Some UE can be implemented for document type also and have ‘Can Override For Document Types' =‘Y’.eg
YFSRecalculateHeaderTaxUE for different tax calculation at order header level for SO, PO and RO.
User Exit can be overridden by an Enterprise and have 'Can Override for Enterprise' = ‘Y’
User exits are not relevant when writing custom transactions
Each UE has its own interface
Java code in service can be used (reusability purpose)
5 UE examples –
YFSBeforeCreateOrderUE - called by the createOrder API before executing any application logic.
YFSGetDeliveryLeadTimeUE - called by the createOrder, scheduleOrder, releaseOrder and scheduleOrderLines
APIs to get the delivery lead time for each line on the order.
YFSGetOrderNoUE - called whenever the createOrder API is called without passing an order number.
YFSGetTagNoUE – called when there is an item that is Tag controlled for which multiple attributes have been
defined as Unique Identifiers
YFSGetExternalResourcePoolCapacityUE - called to get the resource pool's capacities from the external system