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:
-
Create a business rule as defined in the Creating a Business Rule, Function, or Library topic.
-
Edit the business rule as defined in the Editing a Business Rule or Function topic.
-
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.
-
In the Edit Operation dialog, optionally add Messages, as defined in the Localized Messages for JavaScript Business Rules topic.
-
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.
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 accessible at [system]/sdk or from the Resources section of the system's 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 accessible at [system]/sdk or from the Resources section of the system's 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.
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 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 accessible at [system]/sdk or from the Resources section of the system's Start Page. Under the 'Extension API' heading, open the 'Javadoc' link, and search for 'BusinessCondition'.
Business Function
The business function bind provides access to an object implementing the BusinessFunctionScriptingProxy interface. For more information, open the Technical Documentation accessible at [system]/sdk or from the Resources section of the system's Start Page. Under the 'Extension API' heading, open the 'Javadoc' link, and search for 'BusinessFunctionScriptingProxy'.
Note: As an alternative configuration to using a bind, business functions can be dynamically called and evaluated by ID using the getBusinessFunctionByID() method via getBusinessRuleHome(). However, since a business function returns data, carefully evaluate that data to ensure the expected outcome.
Refer to the Scripting API section of the Technical Documentation accessible at [system]/sdk or from the Resources section of the system's Start Page.
For more information, refer to the Business Functions topic in the Business Rules documentation.