Editing a Business Rule in Script Mode

You can edit the script of a business rule.

By default, you create a business rule in graphical mode using the Rule Designer to design the graphical flow of the rule. After you create and save a business rule, you can edit it in graphical mode or script mode. If you choose to edit it in script mode, you can return to editing in graphical mode later.

To edit a business rule in script mode:

  1. Open the rule.
  2. In the Rule Designer, in the drop-down next to Designer, select Edit Script.

    To switch back to graphical mode, in the drop-down next to Edit Script, select Designer.

    When you switch from editing in graphical mode to script mode, if the business rule contains shared components (such as formula and script components) or templates, the script of the business rule contains only references to the shared components and templates in the Script Editor. The complete generated script of the shared components and templates is displayed on the Script tab in the bottom pane.

    Note the following:

    • When you select Edit Script in an ASO rule, the script is automatically converted to Groovy. If you then save the rule, the script is saved in Groovy and cannot be converted back to graphical. To preserve the graphical formatting, select Save As and save the rule with the Groovy script with a different name.

    • When you select Edit Script in a BSO rule, the graphical rule is converted into script mode that is based on calculation script syntax. To convert the script to Groovy, selecting Groovy Script as the Script Type.

    • Do not use the following keywords when editing in script mode:

      • /*STARTCOMPONENT*/

      • /*STARTCOMPONENT:SCRIPT*/

      • /*STARTCOMPONENT:FORMULA*/

      • /*ENDCOMPONENT*/

      • /*STARTRULE*/

      • /*ENDRULE*/

      • /*STARTTEMPLATE*/

      • /*ENDTEMPLATE*/

  3. Edit the script as desired.
  4. Click Save button.

Review the following for additional information: