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.

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 to display the Edit Operation dialog.

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
}