Current Outbound Integration Endpoint Bind

The Current Outbound Integration Endpoint bind is required to generate cross-context output on an OIEP using the Business Rule Based Message Processor selected as the processing engine or in the Business Action Pre-processor. Using this bind in other scenarios will return an exception error when used from a JavaScript.

The Business Rule Based Message Processor allows you to export STEP data using either JavaScript business actions or Java business actions developed via the Extension API. For more information, refer to the OIEP - Configuration Section for Business Rule Based Message Processor topic (here) or access the Technical Documentation button on the Start Page.

The Business Action Pre-processor is defined in the OIEP - Pre-processor - Business Action topic of the Data Exchange documentation here.

The Current Outbound Integration Endpoint bind includes the getContextIDs() function which returns a list of context IDs (String(s)) defined by the contexts that are configured in the OIEP.

In the Business Rule Based Message Processor, the specified Node Handler is invoked once for each batch element to be exported and is responsible for producing the export representation of the node / event. This means that the Node Handler is responsible for exporting the selected contexts.

Configuration

To use any bind:

  1. Create a business rule as defined in the Creating a Business Rule, Function, or Library topic.

  2. Edit the business rule as defined in the Editing a Business Rule or Function topic.

  3. In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic in the Resource Materials online help documentation.

  4. In the Edit Operation dialog, optionally add Messages, as defined in the Localized Messages for JavaScript Business Rules topic.

  5. In the Edit Operation dialog, add JavaScript to call the bind.

Examples

The following JavaScript examples use the related bind(s).

Important: Example scripts should not be used as-is without thorough testing, including updating the script to match object and link types that exist on your system. JavaScript variable names are case-sensitive.

This JavaScript example is for an OIEP with the Business Rule Message Processor and uses the following 'Variable name' text and 'Binds To' options:

  • nodeHandlerSource: Outbound Node Handler Source

  • manager: STEP Manager

  • oiep: Current Outbound Integration Endpoint

  • executionReportLogger: Outbound Execution Report Logger

  • nodeHandlerResult: Outbound Node Handler Result

The JavaScript for this example is:

Copy
var node = nodeHandlerSource.getNode();
if (node != null) {
    
    executionReportLogger.logInfo(node.getManager().getCurrentContext().getID());
    
   
    var contexts = oiep.getContextIDs();
    
    // For each context do invoke the function handleNodeInContext
    var contextIterator = contexts.iterator();
    while (contextIterator.hasNext()) {
        var oneContext = contextIterator.next();
        manager.executeInContext(oneContext, function (contextManager) {
             handleNodeInContext(contextManager, node);
        })
    }
}
    
// do something with the node in one context
function handleNodeInContext(contextManager, node) {
            var contextProdObj = contextManager.getProductHome().getProductByID(node.getID());
             var currentContext = contextProdObj.getManager().getCurrentContext().getID();
             executionReportLogger.logInfo("OIEP Context: " + currentContext);

This JavaScript example is for a Pre-processor Business Action from an OIEP. It uses the following 'Variable name' text and 'Binds To' options:

  • logger: Logger
  • oiep: Current Outbound Integration Endpoint

The JavaScript for this example is:

Copy
var contexts = oiep.getContextIDs();
var contextIterator = contexts.iterator();
    while (contextIterator.hasNext()) {
        var oneContext = contextIterator.next();
        logger.info(oneContext);
    }