Execute Business Action for Event Batch Processing Plugin Parameters and Triggers

The Execute Business Action for Event Batch processing plugin allows the configured business action to be executed once per event batch instead of once per event like when using the Execute Business Action processing plugin. The ability to execute one action for an event batch is especially relevant when communicating with external services that accept batch requests.

The Parameters and Event Triggers sections below contain important information on settings that should be considered when creating an event processor using this processing plugin.

Prerequisites

This section of documentation describes configuration steps for this specific processor, but that is only one part of configuring an event processor. For the full set of instructions on configuring an event processor, refer to the Event Processors topic.

Before configuration of an event processor using the Execute Business Action for Event Batch processor can occur, a business action must be created. For more information, refer to the Business Actions section within the Business Rules documentation here.

The business action referenced from the Execute Business Action for Event Batch plugin has no concept of 'current object.' Therefore, the JavaScript Current Object bind, and most non-JavaScript business action plugins cannot be used. Business actions referenced from the plugin must be made applicable for all object types.

Parameters

Each of the relevant parameters for the Event Processor Wizard 'Configure Processing Plugin' step are described below. Any additional wizard parameters with importance for this plugin are also included in this topic.

To access the 'Configure Processing Plugin' parameters as shown below, the Execute Business Action for Event Batch processing plugin must be selected within the Select Processor parameter during the wizard step 'Configure Event Processor.'

Once the Execute Business Action for Event Batch processing plugin has been selected, click the Next button, and the wizard step 'Configure Processing Plugin' will display.

  • Business Action: Click the ellipsis button () to display the Select Action dialog and select the necessary business action.

  • Context: Select a context from the dropdown. This will determine the context in which the business action will run.

  • Workspace: Select a workspace from the dropdown. This will determine the workspace in which the business action will run.

  • Skip Deleted Nodes: 'Yes' is the recommended setting, which means that deleted objects do not cause the EP to stop or fail.

    When set to 'No', either the EP fails when attempting to process events for deleted objects or the deleted object handling is addressed via JavaScript. When Skip Deleted Nodes is disabled, and the selected business rule commits changes to nodes, use JavaScript to determine if the node exists with the following considerations:

    • Knowledge of the revisability of the node will dictate if node!=null is necessary for globally revisable objects.

    • Knowledge of the node type is required to use the correct Home. For a product node type (shown below with 'manager' bind to STEP Manager), use manager.getProductHome().getProductByID(node.getID()). For a classification node type, use manager.getClassificationHome().getClasificationByID(node.getID()).

    • If the node exists, add relevant JavaScript to perform actions required on nodes that can be edited.

    • If null is returned, consider removing references on related nodes that point to the node in the recycle bin and/or other data cleanup related to a node that is no longer editable.

Important: The Business Action will always read from the configured Context / Workspace independently of how the events are actually triggered.

Once any required configurations are made, click the Next button to display the wizard step 'Schedule Event Processor.'

Refer to the EP - Schedule Event Processor topic within the EP - Schedule Event Processor section of the Event Processors documentation.

As mentioned above, the JavaScript Current Object bind, and most non-JavaScript business action plugins cannot be used. The following JavaScript example iterates the events in a batch and logs the ID of each associated Node:

// logger bound to Logger
// batch bound to Current Event Processor Event Batch
var it = batch.getEvents().iterator();

while (it.hasNext()) {
                var event = it.next();
                var node = event.getNode();
                if (node) {
                                logger.info("Handling " + event.getNode().getID());          
                }
}

It is not recommended to have long-running business actions. This plugin should only be used for cases where it is critical that the business action work on a batch of events.

Event Triggers

For the event processor to execute the business action, the Event Triggering Definitions tab must be correctly configured.

By default, events are triggered on the Approved workspace. Derived event functionality is available for triggering events prior to approval, as defined in the Derived Events topic in the System Setup documentation.

Select an event processor configured to use the Execute Business Action for Event Batch processor and click on the Event Triggering Definitions tab. Use the various triggering flippers to configure the event processor to listen for changes on anything that should cause the event processor to execute. At a minimum, an object type must be selected.

  • Upon creation, the parameters within the Miscellaneous Triggers flipper are enabled.

  • When a configured trigger causes an event to reach the event processor queue, the business action will execute.

  • When an event batch is successfully processed, no message is written into the execution report of the corresponding background process (BGP).

  • If the event processor encounters a problem processing a batch, the event processor will retry the business actions on each event in the batch until all events have been processed or the failing event is identified, in which case the event processor will enter the failed state and stop processing new events.

  • There is no guarantee that actions will not run multiple times, even when batch size is equal to one. However, the likelihood is reduced by having a batch size of one, but performance can then be affected.