Business Functions - Data Source Outbound

The Business Functions data source is available for Excel and CSV export configurations, both in the Export Manager and in outbound integration endpoints (OIEPs). This option uses business functions to export attribute values from child, sibling, and other groupings of indirectly referenced product objects in STEP. Excel and CSV are the only supported formats, as the intention is for these exports to be 'human readable.' Additionally, only product objects are supported.

Business functions work in a similar fashion to multi-level references in Excel and CSV exports, except the intended use of business functions is to pull values from product groupings that are 'implicitly' connected and not directly linked through references.

Note: The Business Functions data source is only supported in In-Memory enabled STEP systems. For more information about the In-Memory Database Component, refer to the In-Memory Database Component for STEP section of the Resource Materials documentation here.

Mapping Business Functions

The user interface for the mapping step of the Export Manager tool and the outbound integration endpoint tool are not exactly the same. For Export Manager, mapping is described in the Export Manager - Map Data topic here. For OIEPs, mapping is handled in the Output Templates section under the Format parameter as described in the OIEP - Event-Based - Output Templates Section topic (here) or the OIEP - Select Objects - Output Templates Section topic (here).

For more information about the additional wizard steps, refer to the Creating a Data Export topic (here) or the Creating an Outbound Integration Endpoint topic (here).

After mapping, most output options can be altered using transformations. For more information, refer to the Outbound Map Data - Transform topic here.

  1. Select the data to be exported for the output tool. For more information, refer to the Data Exchange topic here.
  2. On the Map Data step, in the left panel, select the Business Functions data source.

Note: For an OIEP, you must first select 'Product' from the dropdown at the top of the Mapping tab.

  1. In the right panel, click the right arrow icon to display the Business Function Data Source wizard.

  1. On the Select Business Function screen, select the relevant business function, then click Next.

Note: Only business functions that have Node as input and either Node or List of Nodes as output are valid for this functionality. As such, only these business functions display in the wizard.

  1. On the Select Attribute screen, select the relevant attribute(s), then click Finish. To select more than one attribute, press Shift or Ctrl while making selections. An individual mapping will be created for each selected attribute.

  1. The business function mapping is displayed on the Map Data screen. Follow the previous steps to map additional business functions. In the below screenshot, two business function columns have been mapped by mapping two different attribute selections from the same business function.

In the exported Excel or CSV sheet, one column is returned per mapped business function. If the business function returns multiple nodes, then the attribute value will be found for each node, and the values will display within the column, separated by a multi-separator, e.g., ;.

Example Use Cases and Results

Two sample use cases for this functionality are as follows:

  • Return a list of child product objects where the 'Brand' attribute equals a specified value (e.g., Brand = Omega). If a price value also exists for these objects, return the attribute value(s) from the node(s) to be used in an export.
  • Return a list of sibling product objects where Brand = Omega. If a price value exists for these objects, return the attribute value(s) from the node(s) to be used in an export.

For both of these examples, the following sample data model will be used. The two Omega-branded products will be returned in the export for each example.

Example 1 - 'Return Children' Business Function

For the 'Return Children' example, a business function is used with the Input Parameter of 'Node' and Return Type of 'List of Nodes.' The function is intended to be used for exports performed at the ItemFolder level and will return a list of child product objects where the 'Brand' attribute = Omega and a 'PriceUS' value exists.

The code used in the above example is:

if(node.getObjectType().getID().equals("ItemFolder")){
    var nodes = [];
    var children = node.getChildren();
    if(children){
        var childIter = children.iterator();
        while(childIter.hasNext()){
            var child = childIter.next();
            try{
                var brand = child.getValue("Brand").getSimpleValue();
                if(brand) { 
                    if(brand.equals("Omega")) {
                        var price = child.getValue("PriceUS").getSimpleValue();
                        if(price != null){
                            nodes.push(child);
                        }
                    }
                }
            } catch(e){
                throw e;
            }
        }
    }
    return nodes;
}

Example 1 - 'Return Children' Excel Sheet Result

Building upon the mapping shown in the configuration steps, the exported sheet will return the attribute values for 'Product Name' and 'Price (U.S.)' for all child objects where Brand = Omega and a value exists for Price (U.S.).

In the below example, the export has been performed from the Item Folder level (Bluetooth Soundbars) and has returned the Product Name and Price (U.S.) of the two Omega-branded children.

Example 2 - 'Return Siblings' Business Function

For the 'Return Siblings' example, a business function is used with the Input Parameter of 'Node' and Return Type of 'List of Nodes.' The function is intended to be used for exports performed at the Item level and will return a list of sibling product objects where the 'Brand' attribute = Omega and a 'PriceUS' value exists.

The code used in the above example is:

if(node.getObjectType().getID().equals("Item")){
    var nodes = [];
    var siblings = node.getParent().getChildren();
    if(siblings){
        siblings.remove(node);
        var siblingIter = siblings.iterator();
        while(siblingIter.hasNext()){
            var child = siblingIter.next();
            try{
                var brand = child.getValue("Brand").getSimpleValue();
                if(brand) { 
                    if(brand.equals("Omega")) {
                        var price = child.getValue("US_Price").getSimpleValue();
                        if(price != null){
                            nodes.push(child);
                        }
                    }
                }
            } catch(e){
                throw e;
            }
        }
    }
    return nodes;
}

Example 2 - 'Return Siblings' Excel Sheet Result

Based on the mapping in the export configuration, the exported sheet will return the attribute values for Product Name and Price (U.S.) for all sibling objects where Brand = Omega and a value exists for Price (U.S.).

In the below example, the export has been performed from the Item level (Acme Soundbar Speaker) and has returned the Product Name and Price (U.S.) of the two Omega-branded siblings.