Top
Top
LibraryEASYProcess Reference ManualProcessesServicesProcessFlowWorkshopMerge

Merge Overview

In EASYProcess, all output logs are displayed in XML (screenshot provided). The entire output for a single process canvas is contained in the WorkData node. This is the outermost node and all services that run in the process canvas are its children nodes.

Merge can be used to copy the data from one node onto another. In order to do so, a matching key (child node) must be specified from both the node that will receive the data (Node1) and the node that will provide the data (Node2). The data in the keys must match exactly (case sensitive).

We can use queries to get data from a database, but if the data we want exists in two different databases, the information cannot be retrieved with a single service. In this case, we would need two services and then the data we would want, would be divided among two nodes in the xml output.

If we wanted to take the data from one node and give it to the other, a merge service could be used. In the screenshot, there is one query called “Book” which returns all the books (2 results). There is another service called “GetAuthors”, which has returned 2 books and their authors. If we wanted Node1 (Book) to have Title, Year, and Author below it, here is how we would configure the Merge Service and what the output would look like:


Merge Use Examples
Workshop:ProcessFlowWorkshop
Service:Merge
Inputs
Node1

Node2

Key1

Key2

Override

Compute

Node

Name

Expression

Merge Use Examples

Simple Merge

Two sets of data can be merged together as long as they have a common child node value.

Here we have a process that is retrieving an order in the OrderHistory query.

Then, in OrderTotal, it is finding the sum of all the lines for a given order and it is doing that for all the orders returned from OrderHistory. Here are the results that come back from OrderTotal:

The merge is responsible for merging the WorkData/OrderTotal/ShippedTotal back to the corresponding order in OrderHistory.

This is the end result from the logs of OrderHistory. It now has the nodes from both OrderHistory and OrderTotal.

Merging an Unequal Number of Nodes

Merge can be used to merge an unequal number of nodes. This means that if our initial query has 10 results, we can merge Node2 to Node1 even if Node2 does not also have 10 results.

In this example we have an OrderHistory query that is returning 3 results

Next, the ShippingAddresses query is finding the name (F0101.ABALPH) of each of the ShipTos (F4201.SHSHAN). You’ll notice, only one result returned from the ShippingAddresses, while 3 results returned from the OrderHistory query. This is because if we look into the logs on these orders, we can see that they are all from the same shipping address.

The ShippingAddresses query runs and finds the one result in F0101 matching ABAN8=’4242’

And it returns the name we want.

The merge service will merge that one result to all three orders to they are all given a ShipToName:

Merging with the Same Key for a Cleaner Output

You could clean up your final result after the merge by merging with the same key. In the example above the OrderHistory node has successfully been given a ShipToName based on the ShipTo value. However, there is a left over “ABAN8” which is a duplicate value of “ShipTo”.

We could alter our ShippingAddresses Query to alias ABAN8 as ShipTo so that both Node1 and Node2 have the “ShipTo” child.

Then, if we alter our Merge service to merge on that key

Our end result will have only one “ShipTo”.

Merging with Override On

Override could be used to override a property that has old or unwanted data. In this example we have a query, GetOrderDetails, which returns the WarehouseDescription by adding strings together from the F0116 (Address by Date) table.

The end result is “[City], [State]”. Here is that piece from the select clause of GetOrderDetails (|| is the concat operator in Iseries).

However, due to incomplete data in JDE, this sometimes returns results that look incomplete.

In order to correct this and be able to display it on the webpage with complete data, we could do an override with a merge.

In this particular example we created a new process called WarehouseDescriptionOverrides, which would accept the input of WarehouseDescription and then check against all the known descriptions which would display incorrectly. When the WarehouseDescription was needed to be shown on a page, it would always pass through the new process first. It would utilize the following logic:

This way, there would be only one list of overrides to maintain since everywhere a WarehouseDescription was shown, it came from the output of this process.

After the process call, the Merge service would override the old value of “London,“ with the new correct value of “London, UK” from the process output.

Merging with Compute Nodes

Accepted values are “FromVal” and  “ToVal”.

Addition

The Compute Nodes feature is used to do math between a child node in "Node1" and "Node2".

In this example we have Node1 and Node 2 each with an availability count of the same ItemNumber, but from different BranchPlants.

If you wanted to sum the availability of these two BranchPlants in a Merge service, we would set up our Merge like so:

This works because both nodes have the Availability child node.

The end result is an Availability of 7, the sum of the two availabilities. Also, notice that because we did not set Override=’True’, both BranchPlants are present after the Merge.

Multiplication

Using this same example, we can also show other math operators which can be used in the Compute Nodes. Now the merge has been changed to multiply the two values instead of add.

Subtraction

Similarly, we could also subtract.

Division

We could also divide. The operator for division is ‘/’.

Additional Math Examples


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).