Adding attributes to the outline template
Sterling™ Order Management System Software enables an attribute for indexing in the entity XML definition. These attributes together form an outline template. Based on this template, Sterling Order Management System Software sends the entity data to Order Search.
The commonly used searchable attributes in order and related entities are enabled for indexing in the application-provided entity definition. You can extend the entity definition to add new attributes to the outline template definition to meet your search expectations.
- Include the ORDER_TYPE attribute in the YFS_ORDER_HEADER entity.
- Include the ADDRESS_ID attribute in the YFS_PERSON_INFO entity.
- Include a custom attribute, such as EXTN_CUSTOM_NO in the YFS_ORDER_HEADER entity.
- Include an attribute of a hang-off entity.
- Locate the entity where the attribute is defined. For an order index, this must be either in the YFS_ORDER_HEADER entity (top-level entity) or any one of the entities having a relationship with YFS_ORDER_HEADER.
- For the attribute or entity relationship, set the following based on your requirement:
<UsedForIndexing> <Index EntityName="<XMLName of the top-level entity of the index>" /> </UsedForIndexing>For example, to enable the ORDER_TYPE attribute in the YFS_ORDER_HEADER entity, specify the following:
<Entities> <Entity TableName="YFS_ORDER_HEADER"> <Attributes> <Attribute ColumnName="ORDER_TYPE"> <UsedForIndexing> <Entity EntityName="Order"/> </UsedForIndexing> </Attribute> </Attributes> </Entity> </Entities> - If the attribute to be indexed belongs to a child entity of the top-level entity, first apply
the
UsedForIndexingsetting on the entity relationship between the top-level entity and the child entity. Then, repeat this for each of the attributes to be indexed on the child entity.For example, to enable the indexing of the ADDRESS_ID attribute on an Order's Ship To address, set UsedForIndexing on the relationship between YFS_ORDER_HEADER and YFS_PERSON_INFO, as follows.
<Entity TableName="YFS_ORDER_HEADER"> <RelationShips> <RelationShip Name="PersonInfoShipTo"> <UsedForIndexing> <Entity EntityName="Order" /> </UsedForIndexing> </RelationShip> </RelationShips> </Entity>Now, specify a similar setting on the ADDRESS_ID definition.
<Entity TableName="YFS_PERSON_INFO"> <Attribute ColumnName="ADDRESS_ID"> <UsedForIndexing> <Entity EntityName="Order" /> </UsedForIndexing> </Attribute> </Entity>Similarly, any attribute of the YFS_ORDER_HEADER's child entity can also be marked as indexable by setting
UsedForIndexingon the entity relationship between the YFS_ORDER_HEADER child and its child entity.Note: Sterling Order Management System Software does not support inclusion of derived attributes of an entity in the outline template. Only those attributes (including the VIRTUAL attributes) that are defined in the entity XML definition can be marked as indexable and included in the outline template. - For a custom attribute, this specification can be placed directly in the attribute definition to
add as well as to enable for indexing. Alternately as any application-provided attribute, the
enabling for indexing can be done separately as illustrated in the following example for EXTN_CUSTOM_NO.
<Entity TableName="YFS_ORDER_HEADER"> <Attribute ColumnName="EXTN_CUSTOM_NO"> <UsedForIndexing> <Entity EntityName="Order" /> </UsedForIndexing> </Attribute> </Entity> - To enable indexing for an attribute of a Hang-off table of YFS_ORDER_HEADER, you must enable
them for indexing along with the attribute definition and then separately include the relationship
with the YFS_ORDER_HEADER for indexing.
The relationship for a hang-off entity is derived from the ‘Parent’ specification. For example, a hang-off table is added for YFS_ORDER_HEADER with the following specification:
<Parent ParentTableName="YFS_ORDER_HEADER" XMLName="OrderAdditionalInfo"> <Attribute ColumnName="ORDER_HEADER_KEY" ParentColumnName="ORDER_HEADER_KEY" /> </Parent>This creates a relationship with the name,
OrderAdditionalInfobetween YFS_ORDER_HEADER and the hang-off entity. You must extend this relationship and setUsedForIndexingas follows to include the attributes from the hang-off entity for indexing.<Entity TableName="YFS_ORDER_HEADER"> <RelationShips> <RelationShip Name="OrderAdditionalInfo"> <UsedForIndexing> <Entity EntityName="Order" /> </UsedForIndexing> </RelationShip> </RelationShips> </Entity>Note: You cannot define hang-off in one extension specification and further extend hang-off table to enable its attributes for indexing. Both the definitions of attribute and enabling for indexing must be at one place. - Build and deploy your extensions to update the system with your extensions. For more information about extending entity definitions, see Extending the database.
- You can view the outline template from Index Management console in System Management
Administrator. Alternately, you can retrieve it using the
getIndexStatusAPI.
Adding non-entity attributes to the outline document
As mentioned in the previous section, only the attributes defined in the entity XML definition can be marked as indexable and included in the outline template. But, Sterling Order Management System Software has derived attributes whose value is computed on demand based on more than one attribute values of an entity or from the attribute value of multiple child entities. For example, the ‘Status’ attribute of an Order entity is derived from the release status information of an order. Similarly, the ‘ScacAndService’ attribute of OrderLine and Order are derived from Scac and CarrierServiceCode.
The derived attributes can be relevant for a typical order display UI. Considering its importance, Sterling Order Management System Software provides the ability to send these two attributes in the order outline document even though it cannot be included in the outline template. You can get them in the order outline document by enabling the original attributes, which the derived attribute depends on for indexing.
<Entity TableName="YFS_ORDER_RELEASE_STATUS">
<Attributes>
<Attribute ColumnName="STATUS_QUANTITY">
<UsedForIndexing>
<Entity EntityName="Order"/>
</UsedForIndexing>
</Attribute>
<Attribute ColumnName="STATUS">
<UsedForIndexing>
<Entity EntityName="Order"/>
</UsedForIndexing>
</Attribute>
</Attributes>
<RelationShips>
<RelationShip Name="OrderHeader">
<UsedForIndexing>
<Entity EntityName="Order"/>
</UsedForIndexing>
</RelationShip>
</RelationShips>
</Entity>This enables indexing for the Status and StatusQuantity attributes of YFS_ORDER_RELEASE_STATUS entity. Based on this, Sterling Order Management System Software fetches ‘Status’ also in the order outline document.
<Entity TableName="YFS_ORDER_HEADER">
<Attribute ColumnName="SCAC">
<UsedForIndexing>
<Entity EntityName="Order"/>
</UsedForIndexing>
</Attribute>
<Attribute ColumnName="CARRIER_SERVICE_CODE">
<UsedForIndexing>
<Entity EntityName="Order"/>
</UsedForIndexing>
</Attribute>
</Entity>This enables the Scac and CarrierServiceCode attributes for indexing. Based on this, Sterling Order Management System Software sends the ‘ScacAndService’ attribute in the order outline document.
<Entity TableName="YFS_ORDER_LINE">
<Attribute ColumnName="SCAC">
<UsedForIndexing>
<Entity EntityName="Order"/>
</UsedForIndexing>
</Attribute>
<Attribute ColumnName="CARRIER_SERVICE_CODE">
<UsedForIndexing>
<Entity EntityName="Order"/>
</UsedForIndexing>
</Attribute>
</Entity>This enables the Scac and CarrierServiceCode attributes for indexing. Based on this, Sterling Order Management System Software sends the ‘ScacAndService’ attribute of OrderLine in the order outline document.
<Entity TableName="YFS_REFERENCE_TABLE">
<Attributes>
<Attribute ColumnName="FIELD_NAME1"> <UsedForIndexing><Entity EntityName="Order"/></UsedForIndexing></Attribute>
<Attribute ColumnName="FIELD_VALUE1"> <UsedForIndexing><Entity EntityName="Order"/></UsedForIndexing></Attribute>
</Attributes>
<RelationShips>
<RelationShip Name="OrderHeader"><UsedForIndexing><Entity EntityName="Order"/></UsedForIndexing></RelationShip>
</RelationShips>
</Entity> This specification includes the following in the order outline XML
document: <References>
<Reference Name="value of a FIELD_NAME" Value="value of corresponding FIELD_VALUE"/>
</References>