Configuring a Custom Service Request with Groovy (Advanced)

You can create a service request that uses Groovy, JRuby, or Jython scripting languages to execute a custom process or to route data into another database. To use the script for a service request, the Orchestrator Studio provides an edit area that contains a sample script with instructions on how to modify the script. You can click the Show Shortcut Command icon located above the edit area to view the commands to work with the script. Chapter 10, "Using Scripting Languages" provides information on how to work with sample scripts.

Note: You can also configure a customer service request using JRuby and Jython. See Installing Optional Scripting Languages on the AIS Server (Release 9.2.5.4).

To configure a custom service request with Groovy:

  1. Click the Custom Requests icon on the Orchestrator Studio Home page.

  2. On the Custom Requests side panel, click the New drop-down menu.

  3. From the Script drop-down list, select Groovy.

    You can also select JRuby or Jython as your scripting language.

  4. Create and name the custom request as described in Creating a Component.

  5. On the Custom Requests design page, configure the script to perform the desired action.

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

    The inputs will be placed in the inputMap of the main function and can be retrieved in the script by using the commented out example code.

  7. Click the Load Outputs button.

    This action reads the script and adds any values that are added to the returnMap in the script to the Output grid.

  8. (Optional) In the Output grid, enter a variable name for an output if you want to use the output value in a subsequent orchestration step.

    When you add this service request to an orchestration, this service request name appears in the orchestration inputs grid. As a result, the returned value is available for mapping to subsequent steps in the orchestration.

    Note: Even if no variables are used, all defined outputs are available for mapping using the Orchestration Output feature. See Working with Orchestration Output for more information.
  9. To test the script:

    1. Enter a value in the Test Value column for one or more inputs. If there is any syntax error in the script, details of the error will be displayed in a pop-up window.

    2. Click the Test button.

      The Orchestrator Studio executes the script using the inputs you entered. If the execution is successful, the system populates the results in the Test Output column of the Output grid.

      If you included orchAttr.writeWarn or orchAttr.writeDebug statements in the script, a Logging dialog box is displayed after execution. If you see the warning log, but not the debug log, it indicates that the logging level is set-up to the error level and not the debug level. At runtime, log statements are included in the AIS Server log. These statements can be used for debugging script issues.

  10. Click the Save button.

    The Orchestrator Studio saves the custom Groovy service request. You can then access the orchestration in the Orchestrations design page and add this custom Groovy service request as a step in the orchestration.