Chaining Preprocessors
The Import plugin has the ability to chain multiple preprocessors together. This allows the user to use various preprocessors to obtain the required data. In order to chain preprocessors, you need to create a DOS batch file that will run each preprocessor passing the output to each subsequent preprocessor.
Example
Input data → preprocessor1 → output data → preprocessor2 → output data
Below is an example batch file code that runs two preprocessors (preproc1 and preproc2) and then returns the output to the Import plugin.
This batch file code will check the output of the first preprocessor and fail out if there is an error. It is recommended that you make use of this type of logic.
You can save that batch file code to a batch file in the same directory where the preprocessors exist. Then you would add the “Preprocessor” value to your XINI/XASN to point to the batch file you just created.
You may want to test the preprocessor batch file as well as the individual preprocessors to make sure they are working as needed. In order to do that, you can do the following:
Open a DOS CMD or PowerShell window in the folder where you have your batch file and/or preprocessors.
Copy a data file into that folder and then at the prompt run each preprocessor by hand.
Example:
preproc1 data.xml
preproc2 data.xml
Check the output to make sure they are modifying the data as expected.
Finally, you can run the batch file and check the output.
Example: preprocs.bat data.xml
Related Articles: