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.

Starting with Tools release 9.2.4.3, you can launch the Run Orchestrations page in a new window. This enables you to switch back and forth between the orchestration design page and the Run Orchestrations page.

As orchestrations become more complex, orchestration designers need a simple view into the data that is passed from one step to another to ensure that the orchestration is working as designed. With Tools release 9.2.4.3, you track and inspect an orchestration on a step-by-step basis. You can debug an orchestration by setting breakpoints at strategic points throughout an orchestration and testing the orchestration until you find the problem. This enables you to view the values of input parameters, output parameters, and variables at the specified point.

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.

    Starting with Tools release 9.2.4.3, you can click the New Window button to launch the Run Orchestrations page in a new window. This functionality enables you to switch between the orchestration design page and the Run Orchestrations page. Therefore, you can make changes to the orchestration on the design page while retaining the values that you have entered for the inputs on the Run Orchestration page. Only a single Run Orchestrations child window is launched at any time.

    Starting with Tools release 9.2.4.4, you can override the queues while testing the orchestrations. Select the values in the Job Queue and the Job Queue Scope drop-down menus as required and click Run to test the orchestration with the new values.

    To navigate back to the design page of the parent orchestration, click the Back button on the menu bar of the Run Orchestrations child window.

  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.

11.3 Debugging an Orchestration (Release 9.2.4.3)

This section contains the following topics:

11.3.1 Understanding Debug Orchestration

The JD Edwards EnterpriseOne Orchestrator provides a way to debug your orchestrations. Debug Orchestrations is the tool that you can use to determine the state of your orchestration at any point during execution. Debug Orchestrations provides a view into an orchestration, enabling the designer to run an orchestration step-by-step and ensure that the data is correct at each step until the final orchestration output.

As orchestrations become more complex, orchestration designers need a view of the data that is passed from one step to another to ensure that the orchestration is working as designed. Use the Debug Orchestrations to stop execution so that you can see the state of the orchestration at a specific point by reviewing the values of input parameters, output parameters, and variables. When the orchestration execution is stopped, you can review the output line by line to check for issues.

Note:

As Debug Orchestrations enables you to change the live values of variables and orchestration inputs, it is recommended that you do not use this tool in a production environment.

11.3.2 Debug Orchestration Features

Debug Orchestrations enables you to track and inspect an orchestration on a step-by-step basis. You can debug an orchestration by setting breakpoints at strategic points throughout the orchestration and testing the orchestration until you find the problem. When you debug an orchestration and encounter a step at which the orchestration fails, you can view the output data, and inspect the live values of the variables used in that particular step.

You can repeatedly run the steps and view the variables of a specific step in an orchestration. By observing specific variables while the orchestration runs, you can isolate where the orchestration begins to fail and what exactly it is doing at that stage.

You can debug an orchestration by clicking the Debug button on the Run Orchestrations page. In the debug mode, the Orchestrator Studio renders a view of an orchestration in which you can set breakpoints. The debug mode also contains the Debug Orchestration panel.

The options available on the Debug Orchestration panel are described in the following table:

Table 11-1 Description of Debug Orchestration Features

Icons Description

Run/Resume

Runs an orchestration until completion unless you set up breakpoints.

If you set breakpoints, this option executes an orchestration till the breakpoint is reached or resumes a suspended orchestration.

Step Forward

Executes the orchestration one step at a time. When a step has been executed successfully, a green check mark appears on the step.

Stop Orchestration

Stops the execution of an orchestration.

Show/Hide Orchestration Inputs

Shows or hides the dialog box to enter or edit the initial orchestration inputs.

Clear All Breakpoints

Removes all the breakpoints that you have set for the orchestration in the debug mode.

Quit Debugging

Exits Debug Orchestrations.


For each step, the Debug Orchestration panel displays the following information:

Data

The Data tab displays all the available data that the orchestration consumes and generates, which includes the data that the orchestration consumes from a step. This tab displays the following information:

  • Step Variables. Displays all the variables created by the steps that have been executed. Variables from steps are added to the top of the list, so the most recent variables are shown at the top. Variables of single values like strings and numbers can be changed before resuming the orchestration. Variables containing arrays or JSON objects are read only.

  • Orchestration Inputs. Displays the values for inputs that were defined initially to start the orchestration.

  • System Values. Displays the values for the default inputs: User Address Book Number, User Name, System Date, and Orchestration Input. The values for these inputs represent the originator of the orchestration when executed at runtime. The system values are not editable as these are fixed for an orchestration.

  • History. Displays a record of the values for a variable that is overwritten. For each overwritten variable, click the History icon displayed in its row. The History dialog box lists the orchestration steps where the specific variable is used along with the values. Similarly, the Output tab displays the history of the overwritten output values.
    (Release 9.2.4.4) The values and the history of inputs and variables are also available during the debug. You can also view the number of times the inputs and variables were changed after the orchestration started.

Last Step

Displays the outputs generated from the previous step that was executed in the orchestration.

(Release 9.2.4.4) You can click the Raw Output button to view the complete response of the step in the JSON format.

Output

Displays the accumulative output generated for all the steps in the orchestration until the breakpoint.

Setting Breakpoints

Breakpoints enable you to define where or when to halt the execution of an orchestration. You use breakpoints to run the orchestration until it reaches a certain step.

In the debug mode, a blue circle appears to the right of the step in the orchestration flow. You can set a breakpoint by clicking either the blue circle or the step in the orchestration flow. A blue dot appears next to the orchestration step indicating that the breakpoint has been set.

If you set a breakpoint and click the Run/Resume icon on the Debug Orchestrations panel, the orchestration runs until it encounters that step. To continue execution after the breakpoint, you can use the Run/Resume or Step Forward icons on the Debug Orchestrations panel.

11.3.3 Debugging an Orchestration

To debug 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 shared orchestrations.

    On the Run Orchestrations page, the system a sample request and a response for the selected orchestration.

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

  4. Click the Debug button.

    The orchestration is displayed in the debug mode with blue circles next to the orchestration steps.

    Alternatively, you can access Design Orchestrations from the orchestration design page by choosing the Run icon from the Start node of the orchestration. That takes you to Run Orchestration page on which you can click the Debug button.

  5. Set a breakpoint by clicking the blue circle on the right of the orchestration step.

    The Breakpoint icon is a toggle button. Therefore, you can remove the breakpoint also by clicking the blue dot next to the orchestration step.

  6. On the Debug Orchestration panel, click the Run/Resume icon.

    When the execution stops at a breakpoint, you can use the Data, Last Step, and Output tabs to review and modify the values of the runtime variables.

  7. From the Debug Orchestrations panel, select one of these options:

    • Run/Resume

    • Step Forward

    • Stop Orchestration

    • Show/Hide Orchestration Inputs

    • Clear All Breakpoints

    • Quit Debugging