The standard APIs can be extended to provide information from the custom or hang-off tables. A tool specifically provided for generating the template XML's, templateXmlGen.xml is located in the install_dir/bin directory.
sci_ant.sh -Dtable=TABLE_NAME -f bin/templateXmlGen.xml
For example, consider HF_Order_Header is a hang-off of YFS_Order_Header table. The generated HF_Order_Header_sample.xml is as follows:
<HFOrderHeader Createprogid=" " Description=" " DocumentType=" " EnterpriseKey=" " OrderHeaderKey=" " OrderName=" " OrderNo=" " .... > </HFOrderHeader>
For example, assume HF_Order_Header is a hang-off table with a relationship to the YFS_Order_Header table. The XML template generated by the tool when TABLE_NAME=YFS_Order_Header is passed:
<Order>
<OrderLines>
<OrderLine ........>
<Extn extended attributes >
<HFOrderHeaderList>
<HFOrderHeader Createprogid=" " Description=" " .........>
</HFOrderHeader>
</HFOrderHeaderList>
</Extn>
</OrderLine>
</OrderLines>
</Order>
You can prune this sample XML to include your custom attributes in an API template, such as getOrderDetails output template. However, you cannot modify any of the YFS elements or attributes.
<Order>
<OrderLines>
<OrderLine ........>
<Extn extended attributes >
<HFOrderHeaderList>
<HFOrderHeader Operation="Delete" Createprogid=" " ....... >
</HFOrderHeader>
</HFOrderHeaderList>
</Extn>
</OrderLine>
</OrderLines>
</Order>
The operations such as Create and Modify are run by default. If an entry for that element exists, the API modifies the entries with the recent value. In the case where that element does not exist it creates a new entry.
<Order>
<OrderLines>
<OrderLine ........>
<Extn extended attributes >
<HFOrderHeaderList Reset="true">
<HFOrderHeader>
</HFOrderHeader>
</HFOrderHeaderList>
</Extn>
</OrderLine>
</OrderLines>
</Order>