Oracle by Example brandingLogic Extensions for Business Analysts

section 0Before You Begin

This 30-minute Oracle by Example (OBE) shows you how to build a logic extension to analyze and manipulate a text string with the push of a button on a form.

Background

Logic extensions are a key component of the JD Edwards extensibility framework. They enable nontechnical business analysts as well as JD Edwards developers to use the familiar syntax of EnterpriseOne event rules to create logic without the need for a development client and without the need to build and deploy a package. Logic extensions provide a “no code” way to perform operations such as string manipulation, arithmetic calculations, conditions, loops, and more. You can then add the logic extension as a step in an orchestration or call the logic extension from a form extension.

Scenario

In this company, the Long Address Number field has been used inconsistently. The company issued a new policy that the Long Address Number field should be the first letter of the first and last name, followed by the Address Book number; or in the case if the record is for a company, the Long Address Number should be the first two letters of the name, followed by the Address Book number. You have been given the task of updating some of the records to comply with this policy.
Your solution: A logic extension that is invoked by a custom button on a form extension. When you are finished, your form extension will look like this:

Logic Extension - Generate Long Address Number
Logic Extension - Generate Long Address Number 

The logic extension that you create will:

  • Define data structures for the inputs (Name and Address Book Number) and outputs (Long Address Number) to the logic extension.
  • Use an IF/Else statement to check if the Long Address Number contains a space.
  • If the Long Address Number does contain a space, use the built-in “substring” function to get the first letter of the first name and the first letter of the last name to create a prefix. As you can see in example screenshot above, for Alpha Name “Long, Ben” the prefix has become “BL.”
  • If the Long Address Number does not contain a space, use the built-in “substring” function to get the first two letters of the Alpha Name. For example, “Oracle” would have a prefix of “OR.”
  • Then use the built-in “concatenate” function to combine that prefix with the Address Number. In the example above, the Long Address Number has become “BL1234.”

Logic extensions provide many built-in functions for manipulating text strings, dates, and numbers, as well as functions for reading and writing data to tables, starting workflows, running reports, calling business functions, and manipulating controls on forms. In this OBE, you will simply use the “substring” and “concatenate” text functions to create the Long Address Number string.

What Do You Need?

To perform the steps in this OBE, you will need:

  • Access to a JD Edwards EnterpriseOne environment with Tools Release 9.2.7.0 or later. JD Edwards EnterpriseOne Trial Edition running on Oracle Cloud Infrastructure is suitable, but you can use any environment with the proper Tools release.
  • Security access to use Orchestrator Studio.
  • Access and permission to the create Form Extension in EnterpriseOne, which is enabled through UDO feature security.

section 1Creating the Logic Extension

  1. Sign in to the JD Edwards EnterpriseOne Orchestrator Studio.
  2. Click Logic Extensions.
  3. Click the New button.
  4. In the Name field, enter Generate Long Address Number and in the Description field, enter Use the first letter of the first and last name and append the address book number. If the name is one word, use the first two letters and append the address book number.
  5. Note: In the next few steps, you will define data structures, which are the inputs and outputs for the logic extension. Data structures must come from the EnterpriseOne data dictionary.

  6. In the Data Structure tab, click the +Data Dictionary button to add a data dictionary item.
    The system displays the Data Dictionary window.
  7. In the Alias field, enter ALPH and click the + button.
  8. Change the name of the newly added data dictionary item to Name.
  9. Similarly, add two more data dictionary items and change the names as follows:
    • AN8 to Address Book Number
    • ALKY to Long Address Number
  10. For Name and Address Book Number, enable the Required option.
  11. For Long Address Number, click the IO Type drop-down list and select Output Only.
  12. Logic Extension - Data Structure Tab
    Logic Extension - Data Structure Tab 

    Note: In the next few steps you will define variables. Variables are like data structures except that they can only be used inside of the logic extension; they cannot be passed as inputs or outputs. Variables are like buckets that hold the results of a calculation or function that can then be used for subsequent logic.

  13. From the Name drop-down list, select Duplicate as Variable.
  14. Logic Extension - Data Structure Duplicate as Variable
    Logic Extension - Data Structure Duplicate as Variable 
  15. Repeat Step 11 (duplicate name as a variable for Name) two more times. 
  16. From the Address Book Number drop-down list, select Duplicate as Variable.
    The duplicated variables are displayed in the Variables tab.
  17. In the Variables tab, change the name of the items that were duplicated as follows:
    • Name1 to First Initial
    • Name2 to Last Initial
    • Name3 to Prefix
    • AddressBookNumber2 to Space Position
  18. Logic Extension - Variables Tab
    Logic Extension - Variables Tab 
  19. Click Save. The system displays the Logic tab. 
  20. First, we will add an assignment that uses the index of a text function to determine if there is a space in the name. In the design panel, hover over the line between the Start and the End node and click the + icon.
  21. Select Assignment from the context menu. The Assignment Panel is displayed on the right.
    Note: You can also drag and drop the Assignment statement from the Statements tab to the + icon between the Start and the End nodes in the design panel.
  22. In the Assignment side panel, change the value in the Label field  to Space Position and enter the description as Get position of space in name.
  23. To create the assignment statement as Space Position <- index of(Name,<Blank>):
    1. In the Assignment Block panel, click the Edit icon (Launch Assignment Mapping Wizard).
      The Assignment Builder window is displayed and the Edit icon in the Target field is highlighted.
    2. Assignment Block Panel Edit Icon
      Assignment Block Panel Edit Icon
    3. In the right panel (Object Selector panel), select the Variables icon and select Space Position.
      Note: You can also open the Quick Selection drop-down list to find and select the variable.
      The value Space Position is displayed in the Target field, and the Edit icon in the Source field is highlighted.
    4. In the right panel, click the Text Functions icon, and select index of (String, String).
      The system now highlights the first Edit icon in the source field.
    5. In the right panel, select Name. The system now highlights the second Edit icon in the source field.
    6. In the right panel, select the Literal icon, select Blank from the Type drop-down and then click OK.
    7. Logic Extension - Assignment Builder Window
      Logic Extension - Assignment Builder Window 
    8. Click Close.
    9. Logic Extension - Assignment Block Panel
      Logic Extension - Assignment Block Panel 
  24. Hover between the newly added Assignment and the End node. Click the + button.
  25. From the context menu, select If Else. The If Else panel is displayed on the right.
    Note: The system displays an error icon in the If Else statement in the design panel, and beside the Criteria field in the If Else panel to indicate that the criteria must be entered.
  26. In the If Else panel, in the Description field, enter Does space exist?.
  27. In the If Branch section, in the Branch Label field, enter Yes.
  28. In the Else Branch section, in the Branch Label field, enter No.
  29. Click the Edit (Launch Criteria Builder) icon.
    The Criteria Builder window is displayed and the Edit icon in the Left Operand field is highlighted.
  30. Logic Extension - If Else Statement
    Logic Extension - If Else Statement 
  31. For the Left Operand field, from the Object Selector panel on the right, select the Variables icon and select Space Position.
  32. In the Compare Operator field, click the drop-down list and select >= (greater than or equal to).
  33. For the Right Operand, from the Object Selector panel, select the Literal icon, enter 0(zero) in the Single Value field, and then click OK.
  34. Logic Extension - Criteria Builder Window
    Logic Extension - Criteria Builder Window
  35. Click Close.
    Logic Extension - If Else Panel
    Logic Extension - If Else Panel 
    In a scenario where there is a space in the name, the first letter of the name and the first letter after the space is added in the Long Address Number. In this example, we will use the concatenate text function to create the prefix for the Long Address Number. When there is a space in the name, the format will be displayed as Last Name, First Name.
  36. Hover over the line below the Yes branch, click the + icon, and from the context menu select Assignment.
    The Assignment Block panel is displayed on the right.
  37. Logic Extension - Assignment
    Logic Extension - Assignment 
  38. Change the value in the Label field to Use initials as prefix and in the Description field, enter   Concatenate the initials.
  39. To create an assignment statement to build the prefix for the Long Address Number when there is a space:
    1. In the Assignment Block panel, click the Edit (Launch Assignment Mapping Wizard) icon. The Assignment Builder window is displayed and the system highlights the Edit icon in the Target field.
    2. In the right panel, select the Variables icon and select First Initial. The system now highlights the Edit icon in the Source field.
      Note:
      An error icon will appear until all parameters of the Source field are mapped.
    3. In the right panel, click the Text Functions icon and select substring (String, Numeric, Numeric). The system highlights the first Edit icon of the first parameter in the substring function.
    4. In the right panel, select Name for the first parameter.
    5. Click the Expressions icon and select + (plus symbol).
    6. Select the Space Position variable.
    7. Select Literal and enter 1 (one) in the Single Value field and click OK.
    8.  For the last parameter in the substring function, select Literal and enter 1 (one) in the Single Value field, and then click OK.
    9. On the next row of the assignment, select the Last Initial as the target variable.
    10. In the right panel, click the Text Functions icon and select substring.
    11. In the right panel, select Name for the first parameter.
    12. For the second parameter, click the Literal icon, enter 0 (zero) in the Single Value field, and then click OK.
    13. For the last parameter in the substring function, click the Literal icon and enter 1 (one) in the Single Value field, and then click OK.
    14. The third row  will concatenate the two substrings into the Prefix variable. Select the Prefix variable for the target.
    15. Click the Text Functions icon and select concatenate.
    16. Select the First Initial variable for the first parameter and the Last Initial variable for the second parameter.
    17. Logic Extension - Assignment Builder
      Logic Extension - Assignment Builder 
    18. Click Close.
    19. Logic Extension - Assignment Block Panel
      Logic Extension - Assignment Block Panel 
  40. Click Save.
    In a scenario where there is no space in the name, we will use the first two letters as the prefix for the Long Address Number.
  41. Hover over the line below the No branch, and click the + icon. Select Assignment from the context menu. The Assignment Block panel is displayed on the right.
  42. Change the value in the Label field to Use first two letters as prefix and in the Description field, enter Get first two letters from name.
  43. To create an assignment statement to build the prefix for the Long Address Number when there is no space:
    1. Click the Edit (Launch Assignment Mapping Wizard) icon. The Assignment Builder window is displayed and the system highlights the Edit icon in the Target field.
    2. In the right panel, select the Variables icon and select Prefix.
    3. In the right panel, click the Text Functions icon and select substring (String, numeric, numeric). The system highlights the first Edit icon of the first parameter in the substring function.
    4. In the right pane, select Name for the first parameter.
    5. For the second parameter, click the Literal icon, enter 0 (zero) in the Single Value field, and click OK.
    6. For the last parameter in the substring function, click the Literal icon, enter 2 (two) in the Single Value field, and then click OK.
    7. Logic Extension - Assignment Builder Window
      Logic Extension - Assignment Builder Window 
    8. Click Close.
  44. Click Save.
  45. The last step of the logic extension is to append the prefix with the address book number. Hover over the line just above the End node, and click the + icon. Select Assignment from the context menu.
  46. Change the value in the Label field to Create Long Address Number and in the Description field, enter  Concatenate prefix and address number.
  47. To create an assignment statement to append the address number to the prefix:
    1. Click the Edit (Launch Assignment Mapping Wizard) icon.
    2. Select Long Address Number for the target.
    3. In the Quick Selection field, enter concat, and select concatenate from the filtered results.
    4. In the Quick Selection field, enter prefix and select Prefix from the filtered results.
    5. In the right pane, select Address Book Number for the last parameter of the function.
    6. Click Close.
    7. Logic
                          Extension - Generate Long Address Number
      Logic Extension - Generate Long Address Number 
  48. Click Save.

section 2Testing the Logic Extension

  1. Click the Test tab.
  2. Enter a value in the Input fields for Name and Address Book Number.
  3. Click the Test button. Review the results in the Output field of the Long Address Number row.
  4. Logic Extension - Test Tab
    Logic Extension - Test Tab 

section 3Associating the Logic Extension to a Form Extension

In this section, you will learn how to associate the logic extension to a custom button on a form extension. When you click the custom button, the system will process the logic extension.

  1. Sign in to the JD Edwards EnterpriseOne application, or if you are still logged in to the Orchestrator Studio, select the JD Edwards EnterpriseOne link from the Tools menu.
    Note: If you were previously logged into the EnterpriseOne HTML client, you must log out and log back in to see your newly created logic extension in the following steps. 
  2. In the Fast Path field, enter P01012,and press Enter.
  3. Enter 1234 in the field above the Address Number column in the grid and click Find.
  4. In the Address Book Revision form, select the 1234 record in the grid.
  5. Click the Form Extension icon in the upper right corner of the form.
  6. Address Book Revision Form - Form Extension Icon
    Address Book Revision Form - Form Extension Icon 
  7. Drag the Add Button from the Form Extension Manager to the Address Book tab of the form.
  8. Double click the New button and rename it to Generate Long Address Number.
    You may need to adjust the size of the button as required. 
  9. Generate Long Address
                      Number Button
    Generate Long Address Number Button 
  10. Click the Associate Orchestrations link in the Form Extension Manager panel to open the wizard:
  11. Associate Orchestrations
                      Link
    Associate Orchestrations Link
  12. Click the Logic Extensions tab in the wizard.
  13. Logic Extensions Tab
    Logic Extensions Tab 
  14. In the Associate Logic Extensions wizard, click in the Control field.
  15. In the Address Book Revisions form, click the Generate Long Address Number button and select the Button Clicked event.
  16. Address Book Revision Form - Button Clicked Event
    Address Book Revision Form - Button Clicked Event
  17. Click the Next button in the wizard.
  18. From the Logic Extension Name drop-down list, select Generate Long Address Number.
  19. Associate Logic Extensions Wizard
    Associate Logic Extensions Wizard
  20. Click Next. Move the wizard to the right so the controls on the Address Book tab are visible.
  21. In the Associate Logic Extensions wizard, click in the Mapping Input field for Name, and then hover over the Alpha Name input field on the form. Notice how the cursor changes as the mouse moves over an edit field, click in the Alpha Name field.
  22. Address Book Revisions Form - Alpha Name Field
    Address Book Revisions Form - Alpha Name Field
  23. Click in the Mapping Input field for Address Book Number, then click the Address Number field in the header of the form. Note: Make sure to click the Address Number field and not the label.
  24. Address Book Revisions Form Address Number Field
    Address Book Revisions - Form Address Number Field
  25. Click Next and click Next again on the Execution step of the wizard.
  26. In the Define Outputs step of the wizard, click in the Mapping Output field, and then click the Long Address Number input field on the form.
  27. Long Address Number Field
    Long Address Number Field 
  28. Click Save, then click Close in the wizard.
  29. Click the Save icon on the Form Extension Manager panel, then close the Form Extension Manager.
  30. Generate Long Address Number
    Generate Long Address Number 
  31. To test how the associated logic extension works on the Address Book Revision form for the address number 1234, click the new Generate Long Address Number custom button. Verify that the value in the Long Address Number field is displayed correctly.
  32. Logic Extension - Generate Long Address Number
    Logic Extension - Generate Long Address Number 

section 5Conclusion

In this OBE, you learned how to build a simple logic extension to analyze and manipulate data according to company policy for the format of a field in a form. Then you called that logic extension from a custom button on a form extension. This is just one of the many capabilities of logic extensions. In this exercise, we primarily used the Assignment statement, but there are many other statement types available in logic extensions. Assignment itself has many embedded math, text, and date system functions. The logic extensions that you create can be processed as a step in an orchestration or called directly in a form extension. Be sure to use the Description fields to document your logic extensions well so that others can clearly understand them and use them in their own solutions.


more informationWant to Learn More?