Manually creating inbound map flow

For inbound maps, the flow is driven by what you must do to create the output records containing the application data. You first look at the content and sequence of the application data you want to create. You then look at the EDI transaction set or message that is providing the input data and ask yourself, “How must I group this EDI data so that, when it is read by the program, I will be able to the map the necessary data to the application records and write them in the proper sequence?” You generally need to take the looping structure into account when assigning levels. Based on this analysis, you assign levels (group the EDI data) and create rules.

You assign levels to the segments in the incoming transaction set or message so that they are grouped in a way that allows the application records to be created and written in the correct order. You also use the commands contained in rules and the placement of the rules in the flow to control the order in which the application data records are created and written to the output file. Rules can be invoked by the presence of a segment at a particular level, by the occurrence of a specific value in an element or sub-element, or by encountering a flow point. Flow points are those instances in map flow at which the level changes. Two rules always take place at flow points in inbound maps - the Before Rule and the After Rule. The Before Rule is invoked before the segment referenced by the flow point is mapped; the After Rule is invoked after mapping.

Inbound flow defines the relationship between EDI messages you receive and your application data. You create flow points in inbound flow, and each flow point is an entry in the inbound flow table. The entry contains the current level code, the segment (optionally qualified by an element content) that causes processing to advance to the new level code, and the Before and After Rules that are performed at the flow point.

Each of the inbound segments is linked to a data flow level. An occurrence of a particular segment or qualification within a segment can cause the level to change. For example, on an inbound 850 transaction, the occurrence of a PO1 segment causes the level to change from header to detail. The occurrence of a default segment can also cause the level to change. The special flow point associated with this kind of level change is called a Default inbound map flow entry, and it is invoked by the occurrence of a segment that is not defined as being in the current level. In this case, the presence of the default segment causes the level to change and the rules specified for that flow point to be executed. For instance, since you cannot be certain whether the N1, N3, or N4 will be the final segment in an N1 loop, a default segment may be used to exit the loop if any segment but N1, N3, or N4 are received.

Once you have decided how to group your data, you create and assign levels and rules to the map flow.