Oracle by Example brandingStateful Orchestrations

section 0Before You Begin

This 45-minute Oracle by Example (OBE) shows how to create a “stateful orchestration,” in other words, an orchestration that includes a Pause step to allow the orchestration to suspend processing while some offline task occurs, and then resume processing when the same orchestration instance is invoked again.

In this OBE, you will:

  1. Create a stateful orchestration that includes a Pause step and a Message step with an action link to resume the orchestration.
  2. Open the Stateful Orchestrations application to see that the orchestration has been recorded and is paused.
  3. Resume the orchestration by clicking the action link in the message.
  4. Review the Stateful Orchestrations application to see that the orchestration has run to completion.


Note: This OBE uses a Message step to send a message with an action link to a reviewer. This capability is also available using a notification instead of a Message step.

Background

Starting with JD Edwards EnterpriseOne Release 24 (Tools Release 9.2.8.3), you can use the Stateful Orchestrations feature to designate an orchestration as “stateful” and include one or more Pause steps in the orchestration flow. When the orchestration flow encounters a Pause step, the “state” of the orchestration, that is, all current orchestration variables and their values, is saved in a table, and the orchestration is suspended indefinitely. The orchestration resumes at the Pause step when you call the same orchestration with the same instance ID. In this way you can create orchestrations that may have time gaps or steps that require human or external systems to complete before proceeding.

Scenario

Suppose you want to run a report, send it to a reviewer as a message attachment, and wait for the reviewer to indicate whether the contents of the report are OK or need rework. You can create an orchestration with a Pause step for this requirement where the reviewer can click an action link in the message to indicate “OK” or “Needs Rework.”
This action restarts the orchestration at the Pause step and sends another message indicating the validation status. 

What Do You Need?

  • Access to a JD Edwards EnterpriseOne Release 24 environment with Tools Release 9.2.8.3 or later and the associated Tools roll-up ESU applied. JD Edwards EnterpriseOne Trial Edition running on Oracle Cloud Infrastructure is suitable, but you can use any environment with the proper Tools release.
  • Access to Orchestrator Studio.
  • An EnterpriseOne user ID with an Address Book number assigned to it. Before you begin this OBE, look up the Address Book number for your user ID and make a note of it.

section 1Creating a Stateful Orchestration

In this section, you will create a new orchestration, designate it as “Stateful”; and include steps to run a report, send a message to the reviewer, pause while the reviewer is reviewing, and then send a validation message when the orchestration resumes.

Defining the Orchestration as Stateful and Adding the Report Step

  1. Sign in to the EnterpriseOne Orchestrator Studio.
  2. Click Orchestrations.
  3. Click New.
  4. Complete the following fields:
    • Name: Validate Address Book 
    • Description: Run the Who's Who report to generate an Address Book list, send it in a message to a reviewer, pause the orchestration while the reviewer reviews the list, then send a validation message.
  5. Click the Start icon and select Run Options.
  6. Validate Address Book Orchestration - Run Options Icon
  7. On the Run Options window, enable the Stateful option.
  8. Validate Address Book Orchestration - Run Options Window
  9. Click anywhere outside the Run Options window to close it.
  10. Click the Start icon and select Inputs and Values.
    Notice that an orchestration input for Stateful_Instance_ID is automatically added. This input is required when you call this orchestration to resume it after pausing. You will configure this later in the exercise.
  11. Add the following inputs:
    • Reviewer
    • AB Validation Status 1
  12. Validate Address Book Orchestration - Inputs and Values
  13. Click Save.
  14. Double-click the arrow to the right of the Start menu to display the New Step Type window.
  15. Click Report and then click New.
  16. On the Report page, complete the following fields:
    • Name: Address Book Report 
    • Description: Run the R01402W One Line Per Who’s Who Report 
    • Report Name: R01402W 
    • Report Version: Select XJDE0001.Leave all other inputs and options as the default values.
  17. Validate Address Book Orchestration - Report Step Window
  18. Click Save.
  19. Click Close.
  20. Validate Address Book Orchestration with the Message Step

Adding the Message Step

In this section, you will add a message to a reviewer requesting to review the report.

  1. Double-click the arrow to the right of the Address Book Report step to display the New Step Type menu.
  2. Click Message and then click New.
  3. On the Message page, complete the following fields:
    • Name: Address Book Review Request
    • Description: Send a message to a Reviewer requesting a review of the Address Book report
    • To: Select Address Book 
    • Address Book: ${Reviewer}
    • Subject: Please review this Address Book report
  4. Click in the body of the text editor and enter the following text:

    Please review the attached Address Book report for
    accuracy and duplicated entries.
    When your review is complete, please acknowledge by clicking one of the links below:
  5. Validate Address Book Orchestration - Message Window
  6. Click Save.
  7. Click the arrow next to Links to expand the Links section.
  8. Next to Other Links click Add, and click the arrow next to Other Links to expand the Other Links section.
  9. Links - Add button
  10. Complete the following fields:
    • Other Link ID: Enter AB OK and click Apply
    • Type: Select Orchestration
    • Orchestration: Select Validate Address Book.
    • Link Text: Address Book is OK
      Note: The orchestration you are calling with this action link is the same orchestration that you are creating. Clicking this action link and passing its Instance ID (below) will restart it after pausing.
    • Stateful_Instance_ID: ${Instance_ID} 
    • Reviewer: Leave blank 
    • AB Validation Status: OK
  11. Other Links Section
  12. Click Save.
  13. Next to Other Links click Add to add a second link.
  14. Complete the following fields:
    • Other Link ID: Enter AB Rework and click Apply
    • Type: Select Orchestration
    • Orchestration: Select Validate Address Book. 
    • Link Text: Address Book needs rework
      Note: The orchestration you are calling with this action link is the same orchestration that you are creating. Clicking this action link and passing its Instance ID (below) will restart it after pausing. 
    • Stateful_Instance_ID: ${Instance_ID} 
    • Reviewer: Leave blank 
    • AB Validation Status: Needs Rework
  15. Validate Address Book - Second Link
  16. Click Save.
  17. Click the arrow next to Attachments to expand the Attachments section.
  18. Next to Report Attachments click Add.
  19. Complete the following fields:
    • Report Link ID: Enter AB Report and click Apply
    • Link Text: AB Report 
    • Job Number: ${Job Number} 
    • Server: ${Server} 
    • Attachment Type: PDF
  20. Report Attachment
  21. Click Save.
  22. Scroll back up to the body field of the message and place the cursor on a new line after the last sentence. From the Placeholder drop-down list, select AB OK.Link.
  23. Place the cursor on a new line. From the Placeholder drop-down list, select AB Rework.Link.
    The body of your message should look like this:
  24. Body of the Message with Links
  25. Click Save.
  26. Click Close.
  27. Validate Address Book Orchestration
  28. From the Validate Address Book orchestration page, click the Address Book Review Request message step, and then click Transformations.
  29. Complete the transformations as shown in the following table:

    Input
    Available Values
    Reviewer Reviewer
    Job Number Address Book Report.jobNumber
    Server Address Book Report.executionServer
    Instance_ID Stateful_Instance_ID

    Message Step - Transformations
    Note the transformation, which maps the stateful orchestration Stateful_Instance_ID to the Instance_ID variable you configured in your message link. When you designate an orchestration as stateful, the system assigns it a 36-character unique ID. You must pass this ID as input to an orchestration to restart it after a Pause step. However, since this orchestration will be resumed by the action link in the Message step that is part of the same orchestration, you don’t need to know the 36-character ID; you can simply map it in this transformation.
  30. When you have completed the transformations, click anywhere outside the Transformations window, and click Save.

Adding the Pause and Message Step

To complete the orchestration, you will next add a Pause step and a confirmation message about the validation status of the report.

  1. From the Validate Address Book orchestration page, double-click the arrow to the right of the Address Book Review Request Message step.
  2. From the New Step Type window, select Pause.
    Validate Address Book Orchestration - Pause Step
    Note: The Pause step is only available on the New Step Type menu if you have designated this orchestration to be Stateful. This is the place at which the orchestration will save all internal variables and their current values to the Stateful Orchestration table, and suspend processing until this orchestration is called again with its Stateful_Instance_ID.
  3. Double-click the arrow to the right of the Pause step to display the New Step Type window.
  4. Click Message and then click New.
  5. On the Message page, complete the following fields:
    • Name: Address Book Validation Status 
    • Description: Send the status of the Address Book validation. 
    • To: Select Address Book 
    • Address Book: ${Recipient} 
    • Subject: Address Book Status: ${AB Validation Status}
  6. Click in the body of the message and enter the following text:
    The Address Book validation status is: ${AB Validation Status}.
  7. Validate Address Book Orchestration - Message Step
  8. Click Save.
  9. Click Close.
  10. From the Validate Address Book orchestration page, click the Address Book Validation Status message step, and then click Transformations.
  11. Complete the transformations as shown in the following table:
    Input
    Available Values
    AB Validation Status AB Validation Status 1
    Recipient Reviewer

    Validate Address Book Orchestration - Transformations
    Note that for simplicity in this exercise, we are mapping the Recipient of this message to the same Address Book number as the Reviewer.
  12. When you have completed the transformations, click anywhere outside the Transformations pane, and click Save.
    The orchestration is now complete. In the next exercise you will run it and observe how it suspends processing at the Pause step.

section 2Running the Stateful Orchestration to the Pause Step

In this exercise you will run the orchestration. You can see it process the first two steps: running the Address Book Who’s Who report and sending a message to the reviewer (you). You will use the Stateful Orchestrations application to check its state.

  1. From the Validate Address Book orchestration page, click the Start icon, and then click Run Orchestration.
  2. On the Run Orchestrations page, complete the following input fields:

    • Stateful_Instance_ID: Leave this input blank. 
    • Reviewer: Enter the Address Book number for your user ID. 
    • AB Validation Status: Leave this input blank.
  3. Click Run. The orchestration runs, returning a Status OK (200) and a message: “Orchestration has no output.”
  4. Validate Address Book Orchestration - Run Orchestrations
  5. Close the Run Orchestrations page.
  6. From the Validate Address Book orchestration page, click the Tools drop-down menu and click Stateful Orchestrations.
    Tools - Stateful Orchestrations
    This is a convenient link directly to the EnterpriseOne Stateful Orchestrations application. The Stateful Orchestrations application opens in a new browser tab:
    Stateful Orchestrations Application

    The application collects lots of information about the orchestration. Take special note of the Orchestration Name, the Paused Step, and the Stateful Orchestration ID. At this point the orchestration will remain paused indefinitely, until it is invoked again with its Stateful_Instance_ID as input.

section 3Resuming the Paused Orchestration

To resume a paused orchestration, you call the same orchestration and pass its Stateful_Instance_ID as input.

In the first section of this OBE, we configured an action link in a message to do that.

  1. Return to the JD Edwards Orchestrator Studio browser tab.
  2. From the Tools drop-down menu, select JD Edwards EnterpriseOne.
    The EnterpriseOne web client opens in a new browser tab.
  3. From the drop-down list under your user name in the top right corner, under Manage Notifications, select Message Center.
  4. In Message Center, click the Work Center tab.
    Your Personal In Basket will show a new message: “Please review this Address Book report.”

    Note: If your system is configured with an email server, and if your Address Book number is configured to have messages sent to that email server, you will see this message in your email client instead of in Work Center.
  5. Message Center
  6. Click the message to view it.
  7. Message Center - Actions Link
  8. From the Actions menu, click AB Report.
    Depending on your browser settings, the EnterpriseOne web client launches Submitted Job Search, and the Address Book Who’s Who report opens in a new browser tab for your review.
  9. Address Book Who's Who Report
  10. Close the report browser tab, and close Submitted Job Search.
  11. From Message Center, from the Actions drop-down menu, select either action link:
    • Address Book is OK
    • Address Book needs rework


    Message Center - Address Book Status : OK
    Recall from the first section, we configured this action link to call the Validate Address Book orchestration and map the orchestration’s Stateful_Instance_ID as input. This will resume the orchestration after the Pause step and send the second message. Upon clicking the action link you will see a confirmation that the orchestration has run:
  12. Validate Address Book Result Window
  13. Close the confirmation message browser tab.
  14. Click the Stateful Orchestrations browser tab.
  15. Click Search to refresh the grid on the Stateful Orchestrations window and select the Show Completed Instances option. Note that the status of the orchestration is now COMPLETED.
  16. Stateful Orchestrations Application
  17. Click the EnterpriseOne (Message Center) browser tab.
  18. Click the Refresh icon to refresh the Personal In Basket.
    Notice the new message, “Address Book Status: OK” or “Address Book Status: Needs Rework” depending on which action link you chose. This is the message from the last step in the orchestration when it resumes after the Pause step. The orchestration has now completed.
  19. Message Center - Address Book Status : OK

section 4Summary

In this Oracle-by-Example you learned how to:

  • Create an orchestration and designate it as a “Stateful” orchestration.
  • Add steps to the orchestration, and then add a Pause step.
  • Add additional steps after the Pause step.
  • Configure a message with an action link to call the same orchestration, passing its Stateful_Instance_ID to resume it after the Pause step.
  • Use the EnterpriseOne Stateful Orchestrations application to monitor the orchestration in its paused state and in its completed state.

    This was one simple example of a stateful orchestration being paused while a reviewer took some action (reviewing a report), and then resuming the orchestration with a single click in a message. More complex scenarios might call for multiple Pause steps in an orchestration, or other actors, such as mobile applications or third-party systems, to resume the orchestration after some activity.

more informationWant to Learn More?