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:
Create a stateful orchestration that includes a Pause step
and a Message step with an action link to resume the
orchestration.
Open the Stateful Orchestrations application to see that the
orchestration has been recorded and is paused.
Resume the orchestration by clicking the action link in the
message.
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.
Creating
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
Sign in to the EnterpriseOne Orchestrator Studio.
Click Orchestrations.
Click New.
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.
Click anywhere outside the Run Options window to close it.
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.
In this section, you will add a message to a reviewer
requesting to review the report.
Double-click the arrow to the right of the Address Book
Report step to display the New Step Type menu.
Click Message and then click New.
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
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:
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.
Next to Other Links click Add to add a
second link.
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.
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.
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:
From the Validate Address Book orchestration page, click the
Address Book Review Request message step,
and then click Transformations.
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.
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.
From the Validate Address Book orchestration page,
double-click the arrow to the right of the Address Book Review
Request Message step.
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.
Double-click the arrow to the right of the Pause step to
display the New Step Type window.
Click Message and then click New.
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}
Click in the body of the message and enter the following
text: The Address Book validation status is: ${AB Validation
Status}.
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.
Running
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.
From the Validate Address Book orchestration page, click the
Start icon, and then click Run
Orchestration.
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.
Click Run. The orchestration runs,
returning a Status OK (200) and a message: “Orchestration has
no output.”
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.
Resuming
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.
Return to the JD Edwards Orchestrator Studio browser tab.
From the Tools drop-down menu, select JD
Edwards EnterpriseOne.
The EnterpriseOne web client opens in a new browser tab.
From the drop-down list under your user name in the top
right corner, under Manage Notifications, select Message
Center.
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.
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.
Close the report browser tab, and close Submitted Job
Search.
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:
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.
Click the EnterpriseOne (Message Center)
browser tab.
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.
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.