Oracle by Example brandingCalling Logic Extensions Directly from a Form Extension

section 0Before You Begin

This 45 minute OBE shows you how to use a simple way to build solutions by calling logic extensions directly from form extensions, without the need to include them in an orchestration.

Background

Logic extensions are self-contained, specific sets of instructions for a given purpose that enable you to create business logic to perform operations such as string manipulation, arithmetic calculations etc. without having to know the syntax of any programming language.

You can include logic extensions in orchestrations whenever you need custom logic or calculations, so logic extensions can be used anywhere orchestrations are used. But logic extensions are particularly useful in the context of EnterpriseOne interactive applications; therefore, logic extensions are often used in conjunction with form extensions. This feature enables you to call a logic extension directly from a form extension without having to put it inside an orchestration, thus simplifying the process and giving you fewer user-defined objects to manage.

Scenario

First, we will create a Logic Extension to calculate the Promised Delivery Date to be 5 days after the Requested Date. If there is any delay in the delivery of the item, then the Promised Delivery Date can be updated using this Logic Extension. Now let’s see how we can associate this logic extension to an event on a form.

We use the Sales Order Detail Revisions form to manage information about the status of sales orders and call our logic extension from it. We can use a form extension to add a custom button called Update Delivery Date. Pushing that button will be the event on which our logic extension runs.

Prerequisite

To complete the exercises in this Oracle by Example you will need:

  • Access to Orchestrator Studio in a non-production environment
  • Access to EnterpriseOne web client in the same environment
  • Security permission to create form extensions

section 1Adding the Data Dictionary Items

  1. Sign in to the Orchestrator Studio.
  2. Click Logic Extensions and click New.
  3. In the Name field, enter UpdateDeliveryDate.
  4. To define the Data Structure, click the Data Structure icon.
    Description of logic_extension_data_structure_icon.png follows
    Logic Extensions - Data Structure icon
  5. Click the + Data Dictionary button.
  6. In the Add Data Dictionary window, in the Alias field, enter INT01.
    add_data_dictionary_window.png follows
    Add Data Dictionary Window
  7. Click the Add icon (+). You can see Integer01 listed in the first row. Rename the name field to NumberOfDays. Make sure Input Only is selected in IO type field.
  8. To add another Data Dictionary item, click the + Data Dictionary button again.
  9. In the Add Data Dictionary window, in the Alias field, enter DRQJ, and then click the Add icon.
  10. You can see a new row for DRQJ. Rename the Name field to RequestedDate. Make sure Input Only is selected in IO type field.
  11. To add another Data Dictionary item, click the + Data Dictionary button again.
  12. In the Add Data Dictionary window, in the Alias field, enter RSDJ, and then click the Add icon.
  13. You can see a new row for RSDJ. Rename the Name field to PromisedDeliveryDate. Make sure Output Only is selected in IO type Field. Enter PromisedDeliveryDate in Output Variable Field.
  14. Click Save.

section 1Adding the Assignment Block

In this section, you will learn how to add an assignment block. You can define logic to perform most of the tasks in the assignment block. In the assignment block, you can define actions to perform operations such as calculations, assignments, work with dates, text manipulations, and so on.

In this task, you will add an assignment to add a specified number of days to a date.

  1. Drag and drop the assignment block from the left pane to the Add icon (+) between the Start and End elements.
  2. Note: You can also hover over the line between the Start and End elements and then click the Add icon and select the assignment block.
    assignment_block.png follows
    Assignment Block
  3. In the right pane, in the Description field, enter Extend Delivery Date.
  4. Click the Launch Assignment Mapping Wizard pencil icon, to create assignments for the variables.
  5. In the Assignment Builder window, you can see that the Pencil icon is highlighted the Target column. In the right pane, select PromisedDeliveryDate from the Quick Selection drop-down menu.
  6. You can now see that the Pencil icon is highlighted in the Source column. In the right pane, click the Date Functions icon.
  7. Click on Add days(Date, Numeric) function.
  8. You can now see that the Pencil icon is highlighted in the First parameter. In the right pane, click the RequestedDate data structure.
  9. Now Pencil icon is highlighted in the Second parameter. In the right pane, click the NumberOfDays data structure.
  10. assignment_builder_mapping.png follows
    Assignment Builder - Mappings
  11. Click the X icon to close the Assignment Builder window and verify that your assignments are displayed as shown in the following screenshot:
  12. assignment_block_window.png follows
    Assignment Block Window
  13. Click Save.

    Now we have created the Logic extension to update the delivery date.

section 1Creating a Form Extension

In this section, you will learn how we can create a logic extension to perform some task, and then call that logic extension directly from a form extension.

We will call logic extension from the Sales Order Detail Revisions form to manage information about the status of sales orders and call our logic extension from it.

  1. Sign on to the EnterpriseOne web client. From Orchestrator Studio you can click the Tools drop-down menu and choose JD Edwards EnterpriseOne.
  2. In Navigator, navigate or use Fast Path to the Customer Service Inquiry (P4210) program.
  3. Click Find to load a set of sales order records in the grid.
  4. Select a grid row and click Select.
  5. Note: In this exercise you will update data in the sales order, so choose a sales order that will not affect live production data.
  6. On the Sales Order Details Revisions form, use the Form Extension icon to access the Form Extension Manager side panel.
    Description of sales_order_revision.png follows
    Form Extension Manager Side Panel
  7. Click and drag the Add Button icon from the Form Extension Manager side panel to the form. Drop the Button to the right of the Back button on the form.
  8. Double-click the button and rename it to Update Delivery Date.
  9. Click the Associate Orchestrations link in the side panel. It opens up the Associate Orchestrations wizard.

    This wizard contains a series of steps that you must complete in a sequential order.

  10. Click to place the cursor inside the Control box.
  11. Click the Update Delivery Date button to add it into the Control box.
  12. In the Event drop-down, choose Button Clicked.
  13. In the Saved Orchestration box select the Logic Extensions tab.

    Note: The Logic Extension tab is new with EnterpriseOne Tools 9.2.7. This feature gives you the ability to call a logic extension directly from a form extension without having to build it into an orchestration.

  14. Use the Next button to move to the next step in the wizard.

    Notice the check mark on the previous step. This indicates that the step has been completed.

  15. Description of select_logic_extn.png follows
    Select from Saved Logic Extension

  16. In step 2, Select the Logic extension from the saved drop down list, in this case it is Update Delivery Date. Click Next.
  17. In step 3, in the NumberOfDays row Leave the Mapping Input field blank, in the default value field enter value as 5 and leave the Allow Empty and Allow Input toggle button set to off.

    In the RequestedDate row, map the input from the Requested Date column in the grid. Click to place the cursor in the box next to Requested Date. Then click the horizontal scroll bar on the form several times until you see the Requested Date column. Then click the arrow in the column heading to map Requested Date into the RequestedDate input field. Leave the Allow Empty and Allow Input toggle button set to off. Click Next.

  18. In step 4, you can leave the order of execution selected as Execute Before Event. Click Next.
  19. In step 5, we will map the output of the logic extension, that is, the new Promised Delivery Date, into the Promised Delivery field in the grid.

    Click to place the cursor inside the Mapping Output field.

    On the form extension, in the grid, click the horizontal scroll bar to scroll to the right several times until you see the Promised Delivery column. Click the arrow icon in the Promised Delivery column heading to select it and add it to the Mapping Output field.

  20. Click Save. You can see that the new Logic extension that we created is listed under the Logic extension tab as saved events.
    Description of output_field.png follows
    Save Logic Extension

  21. Close the Wizard.

    Save the Form Extension.

    Close the Form Extension Manager side panel.


section 2Calling Logic Extension from a Form Extension

  1. In the Sales Order Detail Revisions form, scroll to the right until you see the Requested Date column. The date that is in this column is the input into your logic extension. You can change the date or leave it as it is, but note the date.
  2. Now scroll to the right until you see the Promised Delivery column. The logic extension will automatically update the Promised Delivery column by adding 5 days to the Requested Date.
  3. Press the Update Delivery Date button to launch your logic extension. Note that the Promised Delivery Date is populated 5 days from the Requested Date.
    Description of sample-arch-image.png follows
    Updated Promise Delivery Date

    This is how we associate Logic Extensions from a Form Extension.

    The process is very similar to launching an orchestration from a form extension.

    You can choose the form event on which to launch, you can choose which logic extension to launch, and you can associate inputs and outputs.

    However, there is no need to create an orchestration for your logic extension, making the entire process quicker and leaving you with fewer user-defined objects to manage.



more informationWant to Learn More?