Traversal by Association

When developing business interfaces, associations from one business object to another can be defined. Associations are modeled in the BID using the LN Studio. An association contains an association name and the name of the associated business object, as well as a relation from attributes of the business object to all identifiers of the associated business object or component. Such a relation is one-to-one or many-to-one.

Multiple associations can exist from one business object or one component to another. For example, an Order business object or an OrderLine component may contain multiple currency codes or unit codes.

Associations can be used to explicitly add an associated attribute to a BID. For example, adding an itemDescription attribute in an order line. This functionality was available already in the Integration 6.1 release on top of Enterprise Server 8.3.

For traversal by association, the developer does not have to add the associated attributes to the BID or BII. Instead, they can be selected at runtime.

For example, if an itemCode is available on an OrderLine component and an association called ‘OrderedItem’ to the Item business object is defined, then a client application can include the following in a List or Show selection:

<Selection>
<selectionAttribute>OrderLine.OrderedItem.Item.itemDescription</selectionAttribute>
<selectionAttribute>OrderLine.OrderedItem.Item.itemGroup</selectionAttribute>
<selectionAttribute>OrderLine.OrderedItem.Item.cataloguePrice</selectionAttribute>
</Selection>
Note: To make use of traversal by association, both the invoked business object and the associated business object must be generated from LN Studio. Additionally, the generators for BDE proxies (such as Java and .Net) may not support the user of traversal by association at runtime.

In LN Studio you can model association relationships in the BII without a corresponding association in the BID. In that case traversal by association cannot be used. You can however use the association in an attribute implementation.

Traversal by association is available with List, Show, SubscribeList and SubscribeEvent methods. In case of SubscribeEvent, events occurring on the associated business object are by default not detected and published for the subscribed business object.

Note: Traversal by association can only be used for selections; it cannot be used in filters.

Additionally, the business object runtime only supports associations if:

  • An association does not have the same name as an attribute, attribute group or subcomponent.
  • The association is defined from a single component, using attributes from that component only. In the LN Studio, you cannot model an association from multiple components. For example, if a PurchaseOrderLine contains a ‘relatedSalesOrderLine’ attribute and the PurchaseOrder (not the PurchaseOrderLine component) contains a ‘relatedSalesOrder’ attribute, you cannot use these to associate to the SalesOrderLine.
  • The associated business object (or component) is referred to through all its public identifiers. For example, through the itemCode for an association to an Item business object, or through the salesOrderNumber and lineNumber for an association to the SalesOrderLine component of a SalesOrder business object. This is enforced by the LN Studio user interface.