Business Action, Condition, and Function Binds

Within the Configuration group of the 'Binds to' field, business actions, business conditions, and business functions can be called by JavaScript business rules. Use the 'Parameters' field to select the desired action, condition, or function.

The binds can be found within the 'Binds to' dropdown, as shown below.

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.

Business Action

For more information, refer to the Business Actions topic in the Business Rules documentation here.

In this example, the business action is executed only when the business condition returns ‘true’.

The evaluate method on the business condition returns an object and has three methods, in this example, the isAccepted() method is used. For other return methods, refer to the BusinessCondition interface in the Technical Documentation, available on the Start Page. Under the Extension API heading, open the Javadoc link, and search for 'BusinessCondition'.

The business action bind provides access to an object implementing the BusinessAction interface. For more information, open the Technical Documentation, available on the Start Page. Under the Extension API heading, open the Javadoc link, and search for 'BusinessAction'.

Business Condition

For more information, refer to the Business Conditions topic in the Business Rules documentation here.

Refer to the Business Action section above for an example of the business condition bind.

Binding business conditions within JavaScript allows each condition to be evaluated and reported, via the Logger bind (here) or the JavaScript return function.

The business condition bind provides access to an object implementing the BusinessCondition interface. For more information, open the Technical Documentation, available on the Start Page. Under the Extension API heading, open the Javadoc link, and search for 'BusinessCondition'.

Business Function

For more information, refer to the Business Functions topic in the Business Rules documentation here.

The business function bind provides access to an object implementing the BusinessFunctionScriptingProxy interface. For more information, open the Technical Documentation, available on the Start Page. Under the Extension API heading. Under the Extension API heading, open the Javadoc link, and search for 'BusinessFunctionScriptingProxy'.