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:
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.
Creating
the Logic Extension
Sign in to the JD Edwards EnterpriseOne Orchestrator Studio.
Click Logic Extensions.
Click the New button.
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.
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.
In the Data Structure tab, click the +Data
Dictionary button to add a data dictionary item.
The system displays the Data Dictionary window.
In the Alias field, enter ALPH and click the +
button.
Change the name of the newly added data dictionary item to Name.
Similarly, add two more data dictionary items and change the
names as follows:
AN8 to Address Book Number
ALKY to Long Address Number
For Name and Address Book Number, enable the Required
option.
For Long Address Number, click the IO Type
drop-down list and select Output Only.
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.
From the Name drop-down list, select Duplicate
as Variable.
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.
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.
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.
To create the assignment statement as Space Position
<- index of(Name,<Blank>):
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.
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.
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.
In the right panel, select Name. The
system now highlights the second Edit icon
in the source field.
In the right panel, select the Literal icon,
select Blank from the Type drop-down
and then click OK.
Hover between the newly added Assignment and the End node.
Click the + button.
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.
In the If Else panel, in the Description field, enter Does
space exist?.
In the If Branch section, in the Branch Label field, enter Yes.
In the Else Branch section, in the Branch Label field, enter
No.
Click the Edit (Launch Criteria Builder)
icon.
The Criteria Builder window is displayed and the Edit
icon in the Left Operand field is highlighted.
Click Close. 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.
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.
Change the value in the Label field to Use initials
as prefix and in the Description field,
enter Concatenate the initials.
To create an assignment statement to build the prefix for
the Long Address Number when there is a space:
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.
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.
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.
In the right panel, select Name for
the first parameter.
Click the Expressions icon and select
+ (plus symbol).
Select the Space Position variable.
Select Literal and enter 1 (one)
in the Single Value field and click OK.
For the last parameter in the substring function,
select Literal and enter 1 (one)
in the Single Value field, and then click OK.
On the next row of the assignment, select the Last
Initial as the target variable.
In the right panel, click the Text Functions
icon and select substring.
In the right panel, select Name for
the first parameter.
For the second parameter, click the Literal icon,
enter 0 (zero) in the Single Value field,
and then click OK.
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.
The third row will concatenate the two substrings
into the Prefix variable. Select the Prefix variablefor the target.
Click the Text Functions icon and
select concatenate.
Select the First Initial variable for
the first parameter and the Last Initial
variable for the second parameter.
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.
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.
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.
To create an assignment statement to build the prefix for
the Long Address Number when there is no space:
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.
In the right panel, select the Variables icon
and select Prefix.
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.
In the right pane, select Name for
the first parameter.
For the second parameter, click the Literal icon,
enter 0 (zero) in the Single Value field,
and click OK.
For the last parameter in the substring function, click
the Literal icon, enter 2 (two)
in the Single Value field, and then click OK.
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.
Change the value in the Label field to Create Long
Address Number and in the Description field,
enter Concatenate prefix and address number.
To create an assignment statement to append the address
number to the prefix:
Click the Edit (Launch Assignment
Mapping Wizard) icon.
Select Long Address Number for the
target.
In the Quick Selection field, enter concat,
and select concatenate from the filtered
results.
In the Quick Selection field, enter prefix and
select Prefix from the filtered
results.
In the right pane, select Address Book Number for
the last parameter of the function.
Associating
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.
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.
In the Fast Path field, enter P01012,and press
Enter.
Enter 1234 in the field above the Address
Number column in the grid and click Find.
In the Address Book Revision form, select the 1234 record
in the grid.
Click the Form Extension icon in the upper
right corner of the form.
Click Next. Move the wizard to the right
so the controls on the Address Book tab are visible.
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.
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.
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.
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.