Creating actions

You create an action to define reusable logic that accepts parameters and performs side effects without returning a value.

Procedure

  1. Click the Add button Add data type button next to Data model and select Action from the drop-down list.
  2. Replace the default action name with a descriptive name. It is recommended to use a singular form for the function name.
  3. Optional: Define a documentation property using the Documentation text field. This documentation is visible in the prediction menu in the rule editor.
  4. Define the input parameters for the action:
    1. Click Add + in the Input parameters section.
    2. Enter a suitable name for the parameter. It is recommended to use a singular form for the parameter name.
    3. Associate the parameter with a data type that you select from the Type drop-down list.
    4. Optional: Identify the parameter as a list by checking List. When a parameter is identified as a list, it can have multiple values.
    5. Optional: Edit the default verbalization of the parameter.
    6. Repeat for other parameters.
  5. Optional: Click the Verbalization placeholder to edit the default verbalization of the action and edit it directly in the pop-up window that opens.
    The default verbalization is based on the name of the action. You can revert to the default verbalization by clicking Reset.
  6. Define the body of the action:
    1. Select the type of action that you want to define:
      • BFL expression for a simple expression that returns a value.
      • BFL code block for complex logic that requires multiple statements.
    2. In the editor, write the action logic by using the Business Function Language (BFL).

Example

Example: code block to reject a loan with a message

The following example demonstrates a simple action that rejects a loan application and sets a custom rejection message:

loan does not get approved ;
set the message of the loan to message ;

This 'reject' action is constructed with two input parameters: a loan object and a message string.