Creating a Custom Rule with Groovy (Advanced)

Use Groovy to create a custom rule when conditions in a standard rule will not suffice.

Note: You can also create a custom rule using JRuby and Jython. See Installing Optional Scripting Languages on the AIS Server (Release 9.2.5.4).

To create a custom rule with Groovy:

  1. On the Orchestrator Studio Home page, click the Rules icon.

  2. On the Rules side panel, click the New drop-down menu and select Groovy.

  3. Create and name the rule as described in Creating a Component.

  4. On the Rules design page, configure the script to perform the desired action.

    The Orchestrator Studio displays an edit area that contains a sample groovy script with instructions on how to work with the script. See Using Apache Groovy for Custom Service Requests, Rules, and Manipulating Output for more information about the sample Groovy script. Click the Show Shortcut Command icon (?) to view the commands to edit the script.

  5. In the Input grid, enter the names of the inputs.

  6. To test the script:

    1. Enter a value in the Test Value column for one or more inputs.

    2. Click the Test button.

      If you included orchAttr.writeWarn or orchAttr.writeDebug statements in the script, a Logging pop-up is displayed after execution. At runtime, log statements are included in the AIS Server log. These log statements can be used for debugging script issues.

  7. Click the Save button.