To add a new any-to-any map flow entry
Do one of the following:
If this is the first map flow entry, Choose File>New>Add Master Level
For subsequent entries, choose File>New>Add Sibling Level or File>New>Add Child Level.
The Any-to-Any Record Flow window displays, with two tabs - Required and Advanced. The Required tab is active initially.
Under Levels, enter the following information:
Current level – the level assigned to the current record. Select the up arrow and the Levels window displays.
This window is normally blank the first time it is invoked since levels are not usually assigned until map flow is created.
Define a new level on the Levels window and then select it. The program automatically enters the level number in the first text box and the description of the level in the second text box. (Once you have entered levels, you can double-click an existing level on the Levels window to enter it in the Current level text box.)
Parent level – the level attached to the parent record. (All levels except the master level have a parent level.) This level is automatically entered by the program based on earlier choices that you made. If you want to override the level entered by the program, select the up arrow, and the Levels window displays. Double-click an existing level entry or define a new level and then select it. The program automatically enters the level number in the first Parent level text box and the description of the level in the second text box.
Under Record Type specify the attributes for the current flow:
Mandatory record – must occur at this level. If it is not found, the transaction is rejected.
Optional (Error Message) record – may or may not be found in the application data file at this level. If the record does not exist, a warning message appears indicating that it is missing.
Optional (No Message) record – may or may not be found in the application data file at this level. No message appears if the record is missing.
Link Only – indicates that this level is linked to the Master level or a repeating parent level. The link level can only be reached after a break occurs (the key value changes or the end-of-file is reached). When a break occurs, the flow returns to the Master (or repeating parent) level, and proceeds to the link level. If the break was an end of file the processing ends, otherwise the flow returns to the link level parent.
A record is Repeating if there are multiple records of the current type (children/siblings) for each instance of its parent record (for example, multiple details records exist for one header record). Processing at this level ends when a break occurs. A break can occur in two different ways:
If the “Multiple Files” option is checked, processing at this level ends when the break field (such as a Purchase Order Number) changes. If a repeating record has children, the system reads the repeating record and then the child records before reading another repeating record. The repeating record may be either mandatory or optional.
If the input data contains multiple records in a single file and the records are being read in sequence, then the value of the record type determines when a break occurs. For example, if you are processing detail records and a header record is read, this causes a break to occur. (The key field entries are blank.)
Under Records, enter the following information:
Current record – the record that is read in the I/O rule attached to this flow point. You can enter the Current record or you can have the program enter it for you when you choose the Key Field. To select the Current record yourself, select the up arrow and the Records/Tables window displays.
On the Records/Tables window, double-click a record, and the program automatically enters it in the Current record text box.
Parent record – automatically entered by the program based on earlier choices that you made. There is no Parent record if this is the first flow entry (i.e., you chose Add Master Level on the Any-to-Any Map Flow window), because the current record is the master record and it has no parent. If this is a subsequent flow entry (i.e., you chose Add Sibling Level or Add Child Level on the Any-to-Any Map Flow window), there will be a Parent record. If you want to override the record entered by the program, select the up arrow and the Records/Tables window displays. Double-click a record, and ECMap automatically enters it in the Parent record text box. (You can also have the program enter the Parent record for you when you choose the key field.)
Key Field – the field in a child record that is used to link that child record with its parent record. Select the up arrow and the Records/Tables window displays. Open the record and double-click a field to enter it in the Key Field text box. This field is required if the Multiple Files option is checked. (If the Current record text box is blank, the record in which the Key Field is located is also entered in that text box at the same time. If there is already an entry in the Current record text box, it is not replaced. At this point, the program also populates the Parent record text box if it is not already populated.)
Match Field – the field in the parent record that is used to link that parent record with its child records (i.e., if the Match Field in a parent record and the Key Field in a child record are the same, the two records are linked). Select the up arrow and the Records/Tables window displays. Double-click a field to enter it in the Key Field text box. This field is required if the Multiple Files option is checked.
Under Rules on the Required tab, you attach rules to the flow point. These rules contain commands that read data, write data, map data, manipulate data, or do nothing. Enter the following information about the three rules attached to the flow point:
I/O rule – generally contains the commands that read the input application data. In order for ECMap to read the input data, you must use the appropriate read command – an SQL FETCH command for data stored in an ODBC database, a Sequential Read command for data stored in flat files, or a command to read HTML or XML data. The I/O rule is always performed and is performed before any other rule. When the I/O rule executes successfully, the Before and After rules are also executed. Select the up arrow and the Rules window displays. Double-click a rule, and the program automatically enters the rule number in the first I/O rule text box and the rule description in the second text box. If you will not read data at this flow point, use the Do Nothing (0) rule as the I/O rule. (This usually occurs on a Link Only level.)
Before rule – usually contains the mapping commands that perform the actual data conversion. This rule can also include commands to set conditions or manipulate the data being mapped, as well as commands to write the data. The Before rule is performed after the I/O rule and is performed only if the I/O rule was executed successfully. Select the up arrow and the Rules window displays. Double-click a rule, and the program automatically enters the rule number in the first Before rule text box and the rule description in the second text box. If you will not map data at this flow point, use the Do Nothing (0) rule as the Before rule.
After rule – generally contains the commands that write (or insert) the output application data. In order for ECMap to write the output data, you must use the appropriate write command –an SQL Insert command for data to be stored in an ODBC database, a Sequential Write command for data to be written to a flat file, or a command to write HTML or XML data. The After rule is performed after the I/O rule and the Before rule and only if the I/O rule was executed successfully. Select the up arrow and the Rules window displays. Double-click a rule, and the program automatically enters the rule number in the first After rule text box and the rule description in the second text box. When the After rule has successfully executed, you have generated the output data of the map. If you will not write data at this flow point, use the Do Nothing (0) rule as the After rule.
The Advanced tab of the Any-to-Any Record Flow window contains the levels to which the program proceeds based on certain conditions. ECMap automatically places values in these fields as the map flow is built, and these values change as entries are added to the map low. Normally, you would manually enter information on this tab only when you want to override the entries that ECMap automatically places in these fields. (Changes to the defaults entered by the program are generally made as an exception for processing.)
The Next Level is the level to which the program proceeds if another record of the same record type is read. Select the up arrow and the Levels window displays.
On the Levels window, double-click an existing level entry to enter it in the Next Level text box, or if you have not defined your levels, define a new level on the Levels window and then select it. When you select or double-click a level, the program automatically enters the level number in the first Next Level text box and the level description in the second text box.
The Break Level is the level to which the program proceeds at this flow point if the record type of the current record is different from the record type of the previous record. Select the up arrow and the Levels window displays. Double-click an existing level entry to enter it in the Break Level text box, or if you have not defined your levels, define a new level on the Levels window and then select it. When you select or double-click a level, the program automatically enters the level number in the first Break Level text box and the level description in the second text box.