Oracle by Example brandingManaging Report Output in Orchestrations

section 0Before You Begin

This 90-minute OBE shows you how to build an orchestration that executes a report, emails the PDF output, and attaches the PDF report to the JD Edwards EnterpriseOne Sales Order application.

In this OBE, you will create an orchestration that contains these steps:

  • Run the invoice report (R03B505) for a sales order.
  • Run a data request to get the customer’s Address Book number.
  • Send a message to the customer with the invoice attached.
  • Attach the invoice report to the sales order.

Background

Starting with JD Edwards Tools Release 9.2.6.3, you can now download report output to the orchestrator temporary directory. This capability provides more flexibility to manage report output within an orchestration flow. Not only can you include report output in messages, send them to external REST services, or upload reports to FTP sites, but you can now add reports to EnterpriseOne attachments, access report output inside custom scripts, and return report output as files in the orchestration output.

What Do You Need?

  • Access to a JD Edwards EnterpriseOne environment with Tools 9.2.6.3 or later. JD Edwards EnterpriseOne Trial Edition running on Oracle Cloud Infrastructure is suitable, but you can use any environment at the proper Tools release.
  • Security access to use Orchestrator Studio.
  • You must have an email address configured in the Address Book for the customer to whom the email message is to be sent.

section 1Running and Downloading the Invoice Report

This section shows how to build an orchestration that will create the invoice for a sales order and download the report output for later use.

Note: This task relies on EnterpriseOne demo data. You can use other data available in your system to enter a sales order to perform this task.

Creating the Report Step

This section shows how to add a step to call Invoice Print Report (R03B505) for a specific order and download the PDF file of the invoice report immediately after the report is processed.

  1. Sign in to the EnterpriseOne Orchestrator Studio.
  2. On the home page, click Reports.
  3. Select New from the left navigation pane.
  4. Verify that the Execute Report option is selected.
  5. In the Name field, enter SingleOrderInvoiceReport.
  6. Enter the following report details:
    • Report Name = R03B505
    • Report Version= XJDE0001 - Invoice Print - Foreign
  7. Select the Override Version option.
  8. Note: This option is disabled if the report is not secured for this user. Either change to a user who has access to this report version or create a new version for this user.

  9. Expand the Data Selection section.
  10. Click the Delete icons to remove any existing selections.
  11. Click the Add button and type the values in the fields as shown in the below screenshot.
    • AND SDOC is equal to variable ${docNum}
    • AND SDCT is equal to variable ${docType}
    • AND SKCO is equal to variable ${company}
    Data Selection
                        Window
    Data Selection Window
  12. Disable the Fire and Forget option in the top right corner.
  13. Expand the Download Report section and perform the following steps:
    • Enable the Download Immediately option.
    • Select the File Type as PDF.
    • Enable the Overwrite Existing File option. The Keep Temp Files option is disabled by default.
    • Enter invoiceReportFileName in the File Name Variable field.
  14. Click Save.

Creating an Orchestration from the Report Step

  1. On the SingleOrderInvoiceReport page, click the Manage menu and select Create Orchestration.
    A new orchestration with the name SingleOrderInvoiceReport is created.
  2. Replace the old values with the new values as shown below:
    • Name = SendAndAttachOrderInvoice 
    • Description = Run a report to generate an invoice and send a PDF of that invoice to the customer.
  3. Verify the generated orchestration. The input, transformation, and output values are automatically populated.
  4. Click Save.
  5. Set the default values for the orchestration inputs to make testing easier. To do so:
    Click Start and click Inputs and Outputs, and then enter these values in the Orchestration Inputs tab:
    • docNum = 2615
    • doctype = SO
    • company = 00001
  6. Click Save.
  7. To test this step of the orchestration, double-click the Start icon to open the Run Orchestrations window.
  8. Click Run.
  9. Verify your output. Notice that the response is returned only after the report is processed. Also notice the file name. The report output was downloaded to the temp directory with this name.
  10. {
    "Report Name": "R03B505",
    "Report Version": "XJDE0001",
    "Job Number": 38277,
    "Execution Server": "denad618",
    "Port": 4004,
    "Job Status": "D",
    "Object Type": "UBE",
    "User": "JDE",
    "Environment": "JDV920",
    "Submit Date": "2022-03-14",
    "Last Date": "2022-03-14",
    "Submit Time": 195744,
    "Last Time": 195746,
    "OID": "R03B505_XJDE0001",
    "Queue": "QBATCH",
    "File Name": "R03B505_XJDE0001_38277_PDF.pdf",
    "jde__status": "SUCCESS",
    "jde__startTimestamp": "2022-03-14T19:57:44.221+0000",
    "jde__endTimestamp": "2022-03-14T19:57:47.579+0000", "jde__serverExecutionSeconds": 3.358
    }
  11. Click Close to close the Run Orchestrations window.

section 2Sending a Message with the Invoice Report

In this section, you will add two steps to the orchestration: one to get the customer details and another to send a message with the invoice report to the customer.

Adding the Data Request

This section shows how to add a data request to get the customer number.

  1. Access the Orchestrator Studio.
  2. Click Orchestrations.
  3. Click the SendAndAttachOrderInvoice orchestration.
  4. Click Design Mode and click Add + after the report step.
  5. Click Data Request and click the New button.
  6. In the Name field, enter GetCustomerNumber.
  7. In the Table/View Name field, enter F03B11.
  8. Click the Load button.
  9. Click the filter icon next to these data structure fields. Notice that they are displayed in the Filter Criteria section.
     SDOC, SDCT, SKCO
  10. Note: You can type these names into the Filter field to find them quickly.

    Filter Criteria
                      Section
    Filter Criteria Section
  11. Click the Return icon for Address Number (AN8). Verify that Address Number is displayed in the Return Fields and Variables Names section. Enable the Associated Description option.
  12. Return Fields and
                      Variable Names Section
    Return Fields and Variable Names Section
  13. Click Save.
  14. Click Close to close the data request. Verify that the new data request is added to your orchestration.
  15. GetCustomerNumber Data
                      Request
    GetCustomerNumber Data Request
  16. Click the GetCustomerNumber data request and then click the Transformations icon.
    Map the Input fields with the Available Values fields as shown in this screenshot:
  17. Transformations Window
    Transformations Window
  18. Click the End icon and click Outputs and Assertions. In the Outputs tab, enable the Select option for Address Number and Address Number_desc.
  19. Output and
                          Assertions Window
    Output and Assertions Window
  20. Click Save.

Adding the Message Step

Before you proceed with the steps in this section, configure the customer's Address Book record with your email address so that you can receive the message. In the demo data for sales order 2615 the customer's Address Book number is 3007, but it may be different for the sales order you are using. Verify it; then use Address Book and Who's Who to add your own email to the customer Address Book record. Then proceed with the steps below.

  1. Click Design Mode and click Add + after the data request step.
  2. Click Message, and click New.
  3. In the Name field, enter SendInvoiceToCustomer.
  4. From the To drop-down list, select Address Book.
  5. In the Address Book field, enter the variable value as ${customer}.
  6. In the Subject field, enter See Attached Invoice for Order #${docNum}.
  7. Enable the Plain Text option (if this option is available).
  8. In the Body field, enter:
    Hello ${customerName},
    Please see attached invoice for order #${docNum}.
  9. Expand the Attachments section and in the Reports Attachments section, click Add.
  10. In the Link Text field, enter InvoiceReport.
  11. In the Job Number field, enter ${jobNumber}.
  12. In the Server field, enter ${server}.
  13. Verify that Attachment Type is selected as PDF.
  14. Attachment Type as
                      PDF
    Attachment Type as PDF
  15. Click Save.
  16. Click Close to close the message step.
    Verify that the new message step is added to the orchestration.
  17. SendInvoiceToCustomer
                      Message Step
    SendInvoiceToCustomer Message Step
  18. Click Save.
  19. Click the SendinvoiceToCustomer message step and click the Transformations icon.
  20. Map the values in the Input column to the Available Values column as shown in this screenshot:
  21. Transformations
                          Window
    Transformations Window
  22. Click Save.
  23. Double-click the Start icon to open the Run Orchestrations page.
  24. Click Run. You should see this output, with an address number value. You should also receive an email with the report attached.
  25. {
    "Report Name": "R03B505",
    "Report Version": "XJDE0001",
    "Job Number": 38279,
    "Execution Server": "denad618",
    "Port": 4004,
    "Job Status": "D",
    "Object Type": "UBE",
    "User": "JDE",
    "Environment": "JDV920",
    "Submit Date": "2022-03-14",
    "Last Date": "2022-03-14",
    "Submit Time": 202835,
    "Last Time": 202837,
    "OID": "R03B505_XJDE0001",
    "Queue": "QBATCH",
    "File Name": "R03B505_XJDE0001_38279_PDF.pdf",
    "Address Number": 3007,
    "Address Number_desc": "Schwartz Warenhous Germeinscha",

    "jde__status": "SUCCESS",
    "jde__startTimestamp": "2022-03-14T20:28:35.451+0000",
    "jde__endTimestamp": "2022-03-14T20:28:40.291+0000", "jde__serverExecutionSeconds": 4.84
    }
    Attached Report
    Attached Report
  26. Click Close to close the Run Orchestrations window.

section 3Adding the Invoice Report as an Attachment to the Order

In this section, you will create an orchestration step to get the downloaded invoice report and upload it to EnterpriseOne attachments for the order.

Prerequisites

The HTML server must be configured to allow .pdf extensions for the file type media objects.

Defining the Attachment Step

  1. Access the SendAndAttachOrderInvoice orchestration.
  2. Click Design Mode and click Add + after the message step.
  3. Select Attachments and click New.
  4. In the Name field, enter AttachFileToOrderHeader.
  5. In the Structure Name field, enter GT4201A. The system will automatically populate the Keys table.
  6. Keys Table
    Keys Table
  7. In the action section, select the Upload File option.
  8. Leave the Item Name field blank.
  9. In the File Name field, enter the variable value ${filename}.
  10. Click Save.
  11. Click Close to close the attachment step.
    Verify that the new attachment step is added in the orchestration.
  12. AttachFileToOrderHeader
                        Attachment Step
    AttachFileToOrderHeader Attachment Step
  13. Click the AttachFileToOrderHeader attachment step and click the Transformations icon.
  14. Map the Input fields and the Available Values fields as shown in the screenshot below.
    The key values are from the inputs, and the invoiceReportFileName is from the report step.
  15. Tranformations Window
    Tranformations Window
  16. Click Save.
  17. Click the End icon and click Output and Assertions icon.
  18. In the Output tab, enable the Select option for Sequence and itemName from the attachment step.
  19. Output Tab
    Output Tab
  20. Click Save.
  21. Double-click the Start icon to open the Run Orchestrations window.
  22. Click Run. You should see this output, with an address number value. You should receive an email with the report attached. The output also should indicate the report was saved with a sequence in attachments.
  23. {
    "Report Name": "R03B505",
    "Report Version": "XJDE0001",
    "Job Number": 38280,
    "Execution Server": "denad618",
    "Port": 4004,
    "Job Status": "D",
    "Object Type": "UBE",
    "User": "JDE",
    "Environment": "JDV920",
    "Submit Date": "2022-03-14",
    "Last Date": "2022-03-14",
    "Submit Time": 204326,
    "Last Time": 204328,
    "OID": "R03B505_XJDE0001",
    "Queue": "QBATCH",
    "File Name": "R03B505_XJDE0001_38280_PDF.pdf",
    "Address Number": 3007,
    "Address Number_desc": "Schwartz Warenhous Germeinscha",
    "sequence": 1,
    "itemName": "R03B505_XJDE0001_38280_PDF.pdf",

    "jde__status": "SUCCESS",
    "jde__startTimestamp": "2022-03-14T20:43:26.500+0000",
    "jde__endTimestamp": "2022-03-14T20:43:31.225+0000",
    "jde__serverExecutionSeconds": 4.725
    }
  24. Click Close.
  25. To verify that the report was attached in EnterpriseOne, click the Tools menu, and click JD Edwards EnterpriseOne. 
  26. Enter P42101 in Fast Path.
  27. Enter Order Number 2615 (or whichever order number you used to create the invoice. Make sure any other filter values are cleared).
  28. Click Find.
  29. Select the first line, click the Row menu, click Order, and then select Header Attachments.
  30. Manage Existing Order
                      Window
    Manage Existing Order Window
  31. Verify that the PDF file of the report is attached to the order header.
    Attachment Manager
    Attachment Manager
    You can also download and view the report.
  32. Downloaded Report
    Downloaded Report

more informationWant to Learn More?