The For-Each property is used to repeat the occurrences of a target element or node, depending on the total occurrences of a source element or a node in the source file.
For example, an XML schema with a node customer has three elements, first_name, last_name, and state. This schema is used both at the source and at the target end.
Supposing, the source file has 10 occurrences of the customer. Applying the For-Each property on the target node customer, for the source node customer, generates an output file containing 10 occurrences of the customer in it.
Below are the use cases of the For-Each function and are described in the attached document.
Use Case 1: Filtering records from a single source file
Filters require a qualified For-each condition that has a condition (also called a predicate). For-each condition is available under the Properties tab in the Mapping Expression panel.
Use Case 2: Joining data from two source files
We want to select the matching Payroll data from Source 2 by using Source 1’s SSN (common key). So, we will traverse through Source 1, get SSN for each record (in a variable) and go and look up into Source 2 and find the matching data.
Use Case 3: Finding Delta between two files
We want to find delta between two Master data files and select only the Updated and New records.
Use Case 4: Joining data from two branches within a single file
We want to select the matching Payroll data from Record Type 2 by using Record Type 1’s SSN (common key). Suppose the Target’s Record branch needs Payroll data. So, we will traverse through Record Type 1, get SSN for each record (in a variable) and go and look up into Record Type 2 and find the matching data.
Reference:
- Use cases for common Mapping Functions - https://adeptia.com/data-mapping-use-cases
- How to use Mapping Functions - https://docs.adeptia.com/display/AC2/Using+Mapping+Functions
Comments
0 comments
Article is closed for comments.