Editing a Business Library

There are two ways to open the Business Rule editor in System Setup:

  • Select the business rule, right-click, and select Edit Business Rule

  • Select the business rule and select the Edit Business Rule link on the Business Rule tab.

Note: The operation can be accessed directly, without needing to view the Business Rule Editor, by selecting either the 'View', 'Edit Operation', or 'Edit Externally' buttons beside the operation. Refer to the Operations Tab section below for more details.

The Business Rule Editor for libraries allows you to modify most parameters on a business rule. However, the ID, Type, and Scope, which are all shown with read-only text below, cannot be edited.

The following parameters can be set on a library business rule: Name, Description, Operations, and Dependencies.

ID Parameter

Displays the business rule ID assigned while creating the business rule and cannot be modified.

Name Parameter

Displays the business rule name assigned while creating the business rule and can be modified.

Description Parameter

Displays the business rule description assigned while creating the business rule and can be modified.

Type Parameter

Displays the type of business rule being edited. This can be action, condition, a function, or a library.

Operations Tab

The Operations tab allows you to modify the JavaScript code for the business rule. By default, a JavaScript Library operation is added to a new business library object. All required JavaScript for the library will be added to this operation.

To edit the library, click the Edit Operation button.

Operations can also be opened directly from the Business Rule tab via the Edit Operation button.

If preferred, operations can also be edited externally via the Edit Externally button found on the Business Rule tab.

For more information about editing operations externally, refer to the Editing a JavaScript Business Rule Externally topic.

Dependencies Tab

The Dependencies tab allows you to reference business rules to business libraries.

Important: A dependency is required to the library from each business action, business condition, or library where you want to be able to use the library.

  • To add a dependency, click the Add Dependency link, and type an alias. Then select a business library that contains JavaScript. Click OK to add it to the list of Alias / Library entries.

Once the dependency has been declared, functions in the library can be called from JavaScripts.

In the following example, an action has a reference to the library with the alias scriptLib and the function CheckClassification.

if(scriptLib.CheckClassification(node)) {
  //Action to perform in case "CheckClassification" returns true
}