Preview and Save Output
We are now ready to preview and save the output of each target component. When there are multiple target components in the same mapping, each target component has a (Preview) button. Only one component at a time can have the preview enabled. Using the Preview buttons, you can see the intermediate mapping result (in our example, the data mapped to the MergedLibrary component) as well as the final result of the chained mapping (the data mapped to the FilteredLibrary component). The MergedLibrary component also has a (Pass-through) button. The Pass-through button controls how output will be generated (see details below).
Preview and save intermediate and final outputs
If you want to view and save the outputs of both the MergedLibrary and FilteredLibrary components, take the steps below:
1.Press the Pass-through button in the MergedLibrary component.
2.Make sure the Preview button of the FilteredLibrary component is also pressed.
3.Open the Output pane. The Back and Forward buttons enable you to switch between the outputs.
4.Switch to the output you wish to save to a file and click Save Output File in the toolbar. If you wish to save both outputs, click the Save All Generated Outputs button in the toolbar.
When the pass-through feature is active, the Input XML File field of the intermediate component is automatically deactivated. This is because the output generated when you preview the first portion of the mapping between the sources (Books and Library) and the first target (MergedLibrary) is used by default as input when you preview the second portion of the mapping between the first target (MergedLibrary) and the second target (FilteredLibrary).
Preview and save intermediate output
Intermediate components with the pass-through button active cannot be previewed. The preview button of the intermediate component is automatically disabled, because it is not meaningful to preview and let data pass through at the same time. If you want to view and save the output of the intermediate component (MergedLibrary) only, take the steps below:
1.Deactivate the Pass-though button of the MergedLibrary component if the button was previously enabled.
2.Click the Preview button on the MergedLibrary component.
3.Open the Output pane.
4.Click the Save Output File button in the toolbar to save the output to a file.
Preview and save final output
If you want to view and save only the data mapped from the intermediate component to the second target component, follow the instructions below.
1.Deactivate the Pass-though button of the MergedLibrary component if the button was previously enabled.
2.Double-click the header of the MergedLibrary component.
3.Make sure to supply the same file name in the Input XML File field as in the Output XML File field (screenshot below). When you disable the Pass-through button, you can choose what input file should be read by the intermediate component. In most cases, this should be the same file as defined in the Output XML File field. It usually makes sense for the intermediate component to receive one file for processing and forward the same file to the subsequent mapping rather than look for a different file name.
Having the same input and output file for the intermediate component is important when the Pass-through button of the intermediate component is deactivated. This ensures that the output generated when you preview the first portion of the mapping between the sources (Books and Library) and the first target (MergedLibrary) is used as input when you preview the second portion of the mapping between the first target (MergedLibrary) and the second target (FilteredLibrary). If you execute your mapping with MapForce Server (Professional and Enterprise editions) or via generated code, the same names of the input and output files of the intermediate component ensure that the mapping chain is not broken. Note that not having the same input and output file names in the intermediate component (when the Pass-through button is inactive) might cause errors in MapForce, generated code, and MapForce Server execution.
4.Press the Preview button of the FilteredLibrary component.
5.Open the Output pane.
6.Click the Save Output File button in the toolbar to save the output to a file.
Important
•The pass-through feature is available only for file-based components, such as XML, CSV, and text. Database components (Professional and Enterprise editions) can be intermediate, but the pass-through button is not shown. •When the mapping is executed by MapForce, the setting Write directly to final output file (configured from Tools | Options | General) determines whether outputs are saved as temporary files or as physical files. Note that this is only valid when the mapping is previewed directly in MapForce. If this mapping is executed by MapForce Server or by generated code, actual files will be produced at each stage of the mapping chain.
|
You have now finished designing the chained mapping that produces two output files. For your convenience, the mapping design in this tutorial is saved as Tut3_ChainedMapping.mfd.