Before You Begin
This 20-minute OBE (Oracle By Example) shows you how to use the Logic Extension Assertions feature.
In this OBE, you will:
- Create a logic extension to calculate simple mathematical statements using the If Else and assignment statements.
- Test the logic extension and then save the test cases with different inputs and outputs.
- Change the assignment statement to simulate an unexpected change and test the logic extension again using the saved test case.
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 manipulate numerical, date, and string data. Logic extensions can also read and write data to EnterpriseOne tables.
You can validate a logic extension by saving a set of inputs and a set of outputs using the built-in framework provided by the JD Edwards Orchestrator Studio. You can save multiple test cases and run them individually or as a set. This feature enables you to test and revalidate the logic whenever something changes, for example, after applying a software update.
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.4 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.
Creating a Logic Extension
- Sign in to the Orchestrator Studio.
- Click Logic Extensions.
- Click the New button.
- In the Name field, enter
Logic Extension Assertions
. - In the Description field, enter
Demo to test the logic extension assertions feature
. - To add a data dictionary item, click the +Data Dictionary button. The Data Dictionary window is displayed.
- In the Alias field, enter
MATH01
and click the + button. - Change the name of the new data dictionary item to
Input Number.
- Click +Data Dictionary.
- In the Data Dictionary window, enter
MATH01
in the Alias field and click the + button. - Change the name of the data dictionary item to
Output Number.
- From the IO Type drop-down list, select Output Only.
- Click Save. The system displays the Logic tab.
- In the design panel, hover over the line between the Start and the End node and click the + icon.
- From the context menu, select If Else. The
system displays an If Else statement along with the branch
labels in the design panel and an If Else panel on the right.
Note: You can also drag and drop the If Else option from the Statements tab to the + icon between the Start and End node in the design panel. - In the If Branch section, in the Branch Label field, enter
Input = 1
. - Click the Launch Criteria Builder icon.
- In the Criteria Builder window, you can see that the Pencil
icon is highlighted in the Left Operand column. Create this
statement by selecting the values from the right panel:
Input Number = 1.
- Click Close.
- In the design panel, hover over the line after the
Input = 1
label and click the + icon. - From the context menu, select Assignment. The Assignment panel is displayed on the right.
- In the Label field, enter
1 + 1 = 2
. - Click the Launch Assignment Mapping Wizard icon.
- In the Assignment Builder window, you can see that the
Pencil icon is highlighted in the Target column. Create this
statement by selecting the values from the right panel:
Output Number <- Input Number + Input Number.
- Click Close.
- Hover between the
Input=1
and Else label, and click the + icon to insert an Else If Branch. - In the Else If Branch section, in the Branch Label field
field, enter
Input = 2
, and click the Launch Criteria Builder icon. - In the Criteria Builder window, you can see that the Pencil
icon is highlighted in the Left Operand column. Create this
statement by selecting the values from the right panel:
Input Number = 2.
- Click Close.
- Hover over the line after the
Input = 2
label, click the + icon. - From the context menu, select Assignment.
The Assignment Block side panel is displayed on the right. - In the Label field, enter
2 x 2 = 4
. - Click the Launch Assignment Mapping Wizard icon.
- In the Assignment Builder window, you can see that the
Pencil icon is highlighted in the Target column.
Create this statement by selecting the values from the right panel:
Output Number <- Input Number x Input Number.
- Click Close.
- Click Save.
Testing the Logic Extension Using Assertions
- Click the Test tab.
- In the Input field for Input Number, enter
1
. - Click Test. The system processes the
Output Number->Input Number + Input Number (2=1+1)
assignment statement and displays the test result in the Output field correctly as2
. - To save this test case with the current input and output, click Save As. The system displays the Save As window.
- In the Name field, enter
Case Input=1
and click OK. - Change the value in the input field from
1
to2
. - Click Test.
The system processes theOutput Number->Input Number X Input Number (4=2X2)
assignment statement and displays the test result in the Output field correctly as4
.
The status is displayed as Failed since the expected Output is2
from the previous test. - To save this test case with the new input and output, click Save As. The system displays the Save As window.
- In the Name field, enter
Case Input=2
and click OK.
Now, we have saved two test cases with this logic extension
representing two inputs and two expected outputs. - Click the Logic tab.
- Click the 2 x 2 = 4 assignment statement.
- In the Assignment Block side panel, click the Launch
Assignment Mapping Wizard icon.
The Assignment Builder window is displayed. - Click the value in the Source field, and from the right-side
panel, click
-
. - Verify that the assignment statement is displayed as
Output Number <- Input Number - Input Number.
- Click Close.
- Click the Test tab.
- From the Test Case Selection drop-down list, select Case Input=2.
- Click Test.
The Case Input=2 test case fails because the expected output value for the assertion test case is 4, but the actual output is 0.
Note: You can run assertion cases in a batch by clicking Run all tests in this object from the Menu drop-down list. The system displays the Test Report window where you can verify the progress and status of the assertion cases. To download the assertion report in CSV format, click Create Report.
In this exercise, we simulated an unexpected change by changing
the assignment statement. There might be other changes, such as
changes in the inputs to the logic extension from external
systems, table input/output values, and so on. Any change that
creates an output value other than what the assertion case is
expecting will cause the assertion to fail.
To understand how the assertion feature works when something changes in the logic extension, we will simulate some change by changing the logic extension assignment statement in the next steps.