11 Testing Orchestrations

This chapter contains the following topics:

11.1 Understanding Run Orchestrations

You can use the Run Orchestrations page to test the orchestrations. You can access the Run Orchestrations page from the Orchestrator Studio Home page. Alternatively, you can access the Run Orchestrations for a specific orchestration by clicking the Start node of the orchestration, and then clicking the Run Orchestration icon. Oracle recommends that you use the Run Orchestrations page with an EnterpriseOne test environment, because any tests that re performed result in EnterpriseOne transactions that add data to the database.

In the Run Orchestrations page, you can test your personal orchestrations or shared orchestrations to which you have access. When you select an orchestration to test, the Run Orchestrations page displays the inputs that are defined for the orchestration. You can enter values for the inputs in the Name and Value fields and then run the test. Alternatively, the Run Orchestrations page gives you the option to enter raw JSON or XML code for the input.The following figure shows an example of testing an orchestration. The orchestration has been designed to place a customer on credit hold, and customer number 3001 has been entered for the Customer input.

Figure 11-1 Testing an Orchestration

Description of Figure 11-1 follows
Description of ''Figure 11-1 Testing an Orchestration''

The Run Orchestrations page displays a green check mark if the orchestration completes successfully. The Input sections displays the orchestration request in JSON or XML format depending on the Content-Type option that you have selected. Similarly, the Output section displays the orchestration response in either JSON or XML format depending on the Accept option that you have selected. If the orchestration is unsuccessful, the Run Orchestrations page displays an "x" symbol and the Output area displays the error.

To execute the test, the Run Orchestrations page invokes the orchestration on the AIS Server, passing the test values to the orchestration and in turn to the orchestration's service request to perform a transaction in EnterpriseOne. The Run Orchestrations page passes the request to the AIS Server in JSON or XML format. The AIS Server provides a JSON over REST interface through HTTP. The REST interface is a lightweight interface that enables AIS clients to interact with EnterpriseOne applications and forms.

11.1.1 Using cURL to Simulate Testing from a Third-Party Application or IoT Device

As an alternative to testing orchestrations, you can simulate a test from third-party applications or IOT devices using cURL, an open source command-line tool for transferring data with URL syntax via various protocols, including HTTPS.

When an orchestration is saved in the Orchestrator Studio, the name of orchestration is used to define an endpoint on the AIS Server. The endpoint URL is:

http://<server>:<port>/jderest/orchestrator/<orchestrationname>

To invoke this orchestration, third-party applications or devices use a post operation to this url, where <orchestrationname> is the name of the orchestration. In the body of the post, pass the JSON string expected by the orchestration. You can find this JSON string in the Run Orchestrations page, which displays the JSON string in the Inputs section when you test an orchestration.

11.2 Testing an Orchestration

To test an orchestration:

  1. On the Orchestrator Studio Home page, click the Run Orchestrations icon.

  2. In the Run Orchestrations side panel, select an orchestration from personal orchestrations or the shared orchestrations to which you have access.

    The Run Orchestrations page displays a sample request and a response for the selected orchestration in the Input and Output sections.

    The Run Orchestrations page displays the inputs or the name-value pairs, which should be defined in the orchestration as the expected inputs to the orchestration. If the inputs do not appear, return to the corresponding orchestration design page and define the inputs for the orchestration before continuing. An input displayed in italics indicates that it is a required input.

    All orchestrations that are created in Orchestrator Studio 9.2.4 or later are saved as version 3 orchestrations. You cannot change this value. If you want to update a version 3 orchestration that was created in a previous version of the Orchestrator Studio, see Updating to Version 3 Orchestrations.

  3. In the Input section, in the Content-Type down-drop list, select one for the following to display the input request in either JSON or XML format:

    • application/json

    • application/xml

  4. . In the Output section, in the Accept down-drop list, select one for the following to display the output response in either JSON or XML format:

    • application/json

    • application/xml

  5. Select the Send Blank Values check box to send inputs with blank values to the orchestration.

    By default, the Send Blank Values check box in deselected. Therefore, only the inputs for which you have entered the values are passed on to the orchestration and the default values are not be applied to the orchestration.

  6. In the Value column, enter a value for each input.

    These are the values that the orchestration will pass to EnterpriseOne.

  7. If needed, you can click the Add icon (+) to add and define additional inputs.

    For an orchestration that contains an array input, the Name column displays the input as array name[index].array input. This enables you to identify the input as an array. To add multiple array inputs to the same orchestration, add multiple rows to the input grid, copy the array input, paste the array input in the Name column for the multiple rows, and update the index number.

    You can click the Clear button to restore the inputs to its original state and undo any changes that you made in the input area.

  8. Click Run to test the orchestration.

    Depending on the Content-Type and Accept drop-down menu selection, the Run Orchestrations page displays the orchestration input and response in the Input and Output sections, respectively, in JSON or XML format.

    If the test is successful, a green check mark is displayed next to the Output section. If desired, you can access EnterpriseOne and confirm that the transaction was completed by the orchestration.

    If the test is unsuccessful, an "x" symbol is displayed and the Output area displays the error response in the format that you have selected. If the orchestration fails, modify the orchestration and test it again.

    You can use the Refresh Cache button on the Run Orchestrations page to access the components (such as service requests, orchestrations, and so on) that are created outside of your current session. To access the objects that were shared while the session was open, you have to close the session and sign in again.

  9. To test another orchestration or start over, click the Clear button to reset, which clears all the values in the form.

To use JSON input for the orchestration test:

  1. In the Input section, select application/json from the Content -Type drop-down list.

  2. In the Output section, select application/json from the Accept drop-down list.

  3. Click the Raw button.

  4. Enter the input in JSON format directly in the input grid.

    You can click the Raw button again to enter the inputs in the Name-Value input grid.

    The views between the JSON format and Name-Value grid are in sync. The input you enter in the JSON format reflects in the input area in the Name-Value grid or vice versa. If you delete any of the inputs in the JSON format, the deleted inputs are not visible in the Name-Value grid

  5. Click the Format button to verify that the syntax of the JSON is correct.

    If the JSON input is not formatted correctly, the system displays an error message about the JSON.

  6. Click Run to test the orchestration.

    The Input and Output sections display the input and response, respectively, in the JSON format.

To use XML input for the orchestration test:

  1. In the Input section, select application/xml from the Content -Type drop-down list.

  2. In the Output section, select application/xml from the Accept drop-down list.

  3. Click the Raw button.

  4. Enter the input in XML format directly in the input grid.

    You can click the Raw button again to enter the inputs in the Name-Value input grid. The input you enter in the XML format is in sync with input entered in the Name-Value pair or vice versa. Similarly, if you delete any of the inputs in the XML format, the deleted inputs are not visible in the Name-Value grid.

  5. Click the Format button to verify that the syntax of the XML input is correct.

    If not formatted correctly, a dialog box displays an error message.

  6. Click Run to test the orchestration.

    The Input and Output section displays the input and response, respectively, in the XML format.