Example: Pass-Through Inactive
The mapping used in this example (ChainedReports.mfd) is available in the <Documents>\Altova\MapForce2022\MapForceExamples\Tutorial\ folder. This example illustrates how output is generated differently when the pass-through button is deactivated on the intermediate component.
As explained in Example: Pass-Through Active, the goal of the mapping is to produce two separate reports. In the previous example, the pass-through button was active , and both reports were generated as expected and could be viewed in the Output tab. However, if you want to preview only one of the reports (either ReportB.xml or ReportC.xml), then the pass-through button must be deactivated ( ). More precisely, deactivating the pass-through button may be useful if you want to achieve the following:
•Preview only output generated from A to B, and disregard the portion of the mapping from B to C
•Preview only output generated from B to C, and disregard the portion of the mapping from A to B.
When you deactivate the pass-through button as shown above, you can choose whether to preview either ReportB or ReportC (notice that both have preview buttons).
Deactivating the pass-through button also lets you to choose what input file should be read by the intermediate component. In most cases, this should be the same file as defined in Output XML File field (as in this example).
Settings of the intermediate component
Having the same input and output file on the intermediate component is particularly important if you intend to generate code from the mapping, or run the mapping with MapForce Server. As previously mentioned, in these environments, all outputs created by each component in the mapping chain are generated. So, it usually makes sense for the intermediate component to receive one file for processing (in this case ReportB.xml) and forward the same file to the subsequent mapping, rather than look for a different file name. Be aware that, not having the same input and output file names on the intermediate component (when the pass-through button is inactive) might cause errors such as "The system cannot find the file specified" in generated code or in MapForce Server execution.
If you click the preview button on the third component (ReportC), and attempt to preview the mapping in MapForce, you will notice that an execution error occurs. This is expected, since, according to the settings above, a file called ReportB.xml is expected as input. However, the mapping did not produce yet such a file (because the pass-through button is not active, and only the portion of the mapping from B to C is executed). You can easily fix this problem as follows:
1.Click the preview button on the intermediate component.
2.Click the Output tab to preview the mapping.
3.Save the resulting output file as ReportB.xml, in the same folder as the mapping (<Documents>\Altova\MapForce2022\MapForceExamples\Tutorial\).
Now, if you click again the preview button on the third component (ReportC), the error is no longer shown.
When the pass-through button is inactive, you can also preview the StyleVision-generated output for each component that has an associated StyleVision Power StyleSheet (SPS) file. In particular, you can view the HTML version of the intermediate report as well (in addition to that of the final report):
HTML output of the intermediate component