Oracle by Example brandingInvoking an Orchestration from an EnterpriseOne Event

section 0Before You Begin

This 45-minute OBE shows you how to configure EnterpriseOne to invoke an orchestration automatically from an EnterpriseOne event. Invoking orchestrations from EnterpriseOne gives you the ability to provide valuable process automation directly from EnterpriseOne business processes.

In this scenario, when a user enters an occupational health and safety incident in EnterpriseOne, you want the system to send a message with details about the incident to each person associated with the incident. To accomplish this, you will create an orchestration that retrieves details about the incident from EnterpriseOne and sends a message with the details to persons associated with the incident. On the Incident People (F54HS02) table associated with the EnterpriseOne Incident Master (P54HS00) application, you will configure a table trigger on the insert event to invoke the B98ORCH business function, which you will configure to invoke the aforementioned orchestration.

Background

Business analysts use the Orchestrator Studio to create orchestrations that include components that can perform a variety of tasks in EnterpriseOne. Some of these components, which you will create in this tutorial, include: a data request to retrieve data from EnterpriseOne; a custom service request that uses Groovy to manipulate data retrieved from EnterpriseOne; and a message request that sends messages to the EnterpriseOne Work Center or external email systems (if EnterpriseOne is configured with an SMTP server).

Starting with EnterpriseOne Tools 9.2.3, EnterpriseOne provides the B98ORCH business function, which developers can configure to invoke an orchestration or notification automatically from the following events in EnterpriseOne:

  • Table trigger
  • Button on a form
  • Change in the status of an event
  • UBE

What Do You Need?

  • Orchestrator Studio 7.0.0.0 or higher.
  • A minimum of EnterpriseOne Tools 9.2.3 deployed in a JD Edwards EnterpriseOne test environment with an EnterpriseOne Application Interface Services (AIS) Server.
  • An EnterpriseOne development client where you can modify table event rules and configure B98ORCH.

section 1Creating the "NewIncidentPerson" Orchestration

Create an orchestration for sending a message to individuals added to a health and safety incident. In subsequent tasks, you will create and add the following components (orchestration steps) to this orchestration: data request, custom service request, and message request.

  1. Access the Orchestrator Studio and click the Orchestrations icon.
  2. Click New Orchestration.
  3. Complete these fields:
    • Orchestration = NewIncidentPerson
    • Enter Short Description = Send incident details to individuals added to an incident.
  4. Click the Product Code drop-down list and select a customer product code, 55-59.
  5. In the grid, expand Orchestration Inputs and enter these inputs:
    Input Value Type
    IncidentNumber String
    AddressNumber String
    PersonDescription String
  6. Click Save.

section 2Creating the "GetIncidentDetails" Data Request

Add a data request to the orchestration to fetch key incident information from the Incident Master (F54HS01) table to include in the message.

  1. In the NewIncidentPerson orchestration, click the Add Step (+), select Service Request for “Enter Type of Step,” and click OK (+).
  2. In the new Service Request row, click the Edit icon (pencil) and select Data Request.
  3. On the Data Request design page, complete these fields:
    • Name = GetIncidentDetails
    • Enter Short Description = Get incident details to include in a message to person involved in an incident.
  4. Click the Product Code drop-down list and select a customer product code, 55 – 59.
  5. In the Table/View Name field, enter F54HS01 and click Load.
  6.  In the grid, click the Filter icon next to the Incident Number field to add it to the Conditions area on the right.

    This adds a condition for the data request to filter on Incident Number.

  7. Click the Return icon next to the following fields in the grid to specify the data you want returned by the data request:
    • Incident Description
    • Incident Date
    • Incident Time
  8. In the Return Fields and Variable Names area, enter a variable for each return field so that these values can be passed to other steps in the orchestration. You can simply use the field names for the variable names:
    • Incident Description = Incident Description
    • Incident Date = Incident Date
    • Incident Time = Incident Time
    This image shows the NewIncidentPerson orchestration with the GetIncidentDetails data request added to it.
    GetIncidentDetails Data Request
  9. Save the data request, and then click Close to return to the orchestration.
  10. In the Service Request row, click the down arrow and select GetIncidentDetails.
  11. In the Transformations area, click the Available Values drop-down list and select IncidentNumber to map this orchestration input to the ${Incident Number 1} service request input.
  12. Save the Orchestration.

    At this point, the orchestration should look like this:

    This image shows the NewIncidentPerson orchestration with the GetIncidentDetails data request added to it.
    NewIncidentPerson Orchestration with Data Request

section 3Creating a Custom Service Request (with Groovy) to Format the Date and Time

The data request returns the date and time in a format that is not desirable to include in a message. In this task, you will create a custom service request that uses Groovy to convert the date and time to an appropriate format for the message.

  1. Click the Insert Step After icon to add a step to the orchestration, select Service Request, and click OK (+).
  2. In the new Service Request row, click the Edit icon (pencil), and then select Custom.
  3. On the Service Request design page, complete these fields:
    • Name = FormatIncidentDateTime
    • Enter Short Description = Format the incident date and time to include it in the message.
  4. Click the Product Code drop-down list and select a customer product code, 55 – 59.
  5. If the Groovy option is not selected, select it.
  6. In the Input grid below the code area, add these inputs:
    • Date
    • Time
  7. In the Output grid, add the following outputs and associated variable name values:
    Output Variable Name
    outDate outDate
    outTime outTime
  8. Click this Groovy script to open it and copy and paste the code into the code area.

    The comments in the code describe the processing.

  9. Save the service request.
  10. In the Test Values column in the Input grid, enter the following test values:
    • Date = 20181105
    • Time = 150834
  11. Click Test and verify the Test Output column contains these formatted values: Mon, Nov 5, 2018 and 15:08:34.
    This image shows the Custom Service Request design page with Groovy for converting date and time format.
    Data Format Conversion Test
  12. Save the service request, and then click Close to return to the orchestration.
  13. In the new Service Request row, click the down arrow and select FormatIncidentDateTime.
  14.  In the Transformations section, map the custom service request inputs to the orchestration inputs:
    Custom Input Available Values (orchestration inputs)
    Date Incident Date
    Time Incident Time
  15. Save the orchestration.

section 4Creating the "InvolvedPersonMessage" Message Request

Create the message that will be sent to the person involved in the incident.

  1. With the Custom row selected, click Insert Step After icon, select Service Request, and then click OK (+).
  2. In the new Service Request row, click the Edit icon (pencil) and select Message.
  3. On the Message design page, complete these fields:
    • Service Request = InvolvedPersonMessage
    • Enter Short Description = Message sent to person involved in an incident.
  4. In the To field, select Address Book, and then enter the following variable in the Address Number field:
  5. ${MsgAdddressNo}

  6. Enter the following in the subject field:
  7. Involved in Incident: ${IncidentNumber}

  8. In the body, create the following message, which includes variables for including information from the incident.
  9. Dear ${PersonDescription}, 

    You have been added to incident Number ${IncidentNumber} - ${IncidentDescription}, as an involved party. 

    The incident occurred on ${IncidentDate} at ${IncidentTime}.
    We will be in contact with you to request more information about the incident.

    Thank you
    - The Health and Safety Team.

  10. Save the message request and then click Close to return to the orchestration.
  11. In the Server Request row, click the down arrow and select InvolvedPersonMessage.
  12. In the Transformations area, map the following orchestration inputs to the message request (service request) inputs:
    Service Request Input Available Values
    ${IncidentNumber} IncidentNumber
    ${PersonDescription} PersonDescription
    ${IncidentDescription} Incident Description
    ${IncidentDate} outDate
    ${IncidentTime} outTime
    ${MsgAddressNo} AddressNumber
  13. Save the orchestration.

section 5Testing the NewIncidentPerson Orchestration

Use the Orchestrator Client to test the orchestration. Because you have not yet configured the event in EnterpriseOne to call this orchestration (which you will do later in this OBE), for the test you need to supply the following inputs to the orchestration: incident number, address number, and description of the person.

Before you test the orchestration, if you do not have an incident with a person associated with it in your test environment, then use P54HS00 to create an incident and add an involved person to it. Make sure that you have a way to access the message sent to the involved person. The message can be sent to the EnterpriseOne Work Center or an external email system if the involved person’s address number has an email address associated with it (with a messaging indicator of 1). If an email address is used, your environment must be set up with an SMTP server to send emails from EnterpriseOne.

  1. In the Orchestrator Studio, click the Tools link and then click the Orchestrator Client icon.
  2. Use your EnterpriseOne credentials to sign in.
  3. In the Orchestrator Client, click the Orchestrator Name drop-down list and select NewIncidentPerson.
  4. For the inputs, enter the appropriate values for the incident that you created.

    As an example, the response shown below shows the results of entering the following values for the inputs:

    • IncidentNumber = 218
    • AddressNumber = 7
    • PersonDescription = Curie, Marie
  5. Click Run.

    The Output area in the Orchestrator Client should display a response similar to this:

    This image shows response to the orchestration test.
    Orchestration Response
  6. Access either the Work Center or email account of the person associated with the incident. The message should look similar to the following message, containing values associated with the incident you created:
    This image shows an example of the message sent to the involved person.
    Message Sent to Involved Person

    After verifying the orchestration produced the desired results, proceed to the next task to configure EnterpriseOne to invoke this orchestration automatically when a person is added to a health and safety incident.


section 6Configuring B98ORCH to Invoke the Orchestration

The F54HS02 table stores persons associated with an incident. In this task, you will edit the After Record is Inserted event in the table event rules for this table. When B98ORCH is called from table event rules, it in turn makes a REST call to the Orchestrator on the AIS Server. When running locally, the REST call will be executed by the local development client (local Enterprise Server). The Enterprise Server or development client must be configured with an AIS Server for this call to succeed, which requires the following configuration in the jde.ini:

    [FORMSERVICE]
    AISHost=myaisserver.com
    AISMaxConcurrentCalls=5
    AISPort=8123
    AISProtocol=https

Important: The AIS Server must be using the same security server as the EnterpriseOne web client because the security token generated when the user signs in to EnterpriseOne is passed to this AIS Server.

Remember that if the involved person has an external email associated with their address number in EnterpriseOne, the Enterprise Server must be configured with an SMTP server to deliver the email to an external email system.

  1. Sign in to the EnterpriseOne development client and launch Object Management Workbench (OMW).
  2. Find the F54HS02 – Incident People table and add it to a project.
  3. Check out F54HS02.
  4. To edit the object, select the Design Tools tab, and then click Start Table Trigger Design Aid.
  5. Select the After Record is Inserted event.
  6. B98ORCH only accepts strings as inputs, so create the following two variables to convert non-string values to strings using DD item TSTRING:

    evt_szIncidentNumber_TSTRING
    evt_szAddressNumber_TSTRING

  7. Create the following two assignment statements, with conversions, for Address Number and Incident Number to be assigned to the two string variables:

    VA evt_szAddressNumber_TSTRING = [TK Address Number]
    VA evt_szIncidentNumber_TSTRING = [TK Incident Number]

  8. Add the function call to B98ORCH, mapping the parameters as shown in the following image:

    Note: This call uses the provided name-value pairs to send the three input values to the orchestration. The names are provided as literal strings and the values are from the table column values (or variables that were set with table column values).

    This image shows the parameter mappings for the function call to B98ORCH.
    Parameter Mappings for the Call to B98ORCH
  9. Save the changes to Event Rules Design, and then check in the changes to the project.
  10. Build and test the package in your test environment before testing invoking the orchestration from the event.

section 7Testing Invoking the NewIncidentPerson Orchestration from an EnterpriseOne Event

Add a person to an incident in P54HS00 to test invoking the NewIncidentPerson orchestration automatically from the event. Make sure you have access to the involved person’s Work Center or external email system.

  1. Access P54HS00 in EnterpriseOne.
  2. Add an incident and a person, or simply add a person to an existing incident.
  3. Access the person’s Work Center or external email system and verify that the involved person received a message about the incident.

    If the message was received, then congratulations! You properly configured an event in EnterpriseOne to invoke an orchestration.


more informationWant to Learn More?