When Importing, you can direct PypeServer to run a script, application or other executable immediately prior to importing files.
Also see the document Importer Preprocessing Details in the PypeServer Training System.
Contents
Configuring a Preprocessor Directive 3
Preprocessors allow customers (or PypeServer development) to modify importer files immediately prior to importing. Some reasons for modifying files:
Data cleanup
Replacing names with names more common across the company
Validating import files
Adding data that is located in other systems (that can be associated with the data exported from CAD).
The preprocessor can modify the file and then save it back to disk.
Once run successfully, the same, but modified file is left in place and is passed onto the importer.
If the preprocessor fails, then a copy of the original import file is written over the potentially modified file, and the importer is not called.
The user may elect to "Keep preprocessed files after import"-which causes PypeServer to create a copy of the import file before running the pre-processor.
The copy is saved in the same directory (given it has rights to do so).
The preprocessor can also perform other processing tasks, such as:
Launching a number of other preprocessor functions.
Opening and parsing the import file and sending importing information to other company workflows or data systems.
Copying the importer file to some other location for access downstream, such as by welders or in field assembly teams.
Deriving information from the import file, and then finding related files to stage for downstream uses (such as drawings for welders, order notifications for procurement).
You can only invoke one preprocessor at a time for any given import type. That being said, your preprocessor can launch sub-tasks (more preprocessors) if needed.
Once you set the preprocessor directive for a given importer type, it will persist through application start and stop until you remove or change it.
Preprocessors are global. Once set they will be run at all locations when preprocessing.
The filepath to the preprocessor must resolve to the preprocessor from anywhere you plan to run the importer. If you are importing from multiple remote seats it is recommended that you save these in. "\\PYPESERVER\PypeServer Documents\Preprocessors"
You will find the Preprocessor tab in all importer types.
The preprocessor file must be something that PypeServer can invoke in a new process.
This can be a .bat file, power script, executable, or any other executable.
The invocation of the process waits until the process has completed
The executable may even pop up a dialog to advise or require input from the user.
The return value of zero from the process indicates success. All other values represent a fail.
Upon success, the importer will continue with the importing.
Upon fail, the importer will not continue importing this file, and a copy of the original import file will be copied back to the import file location.
The preprocessor modifies the file. Your preprocessor should manage conditions (or prevent conditions if that is desired) where users may attempt to import the same file twice.
As mentioned above, the filepath to the preprocessor must resolve to the preprocessor from anywhere you plan to run it. If you are importing from multiple remote seats it is recommended that you save these in "\\PYPESERVER\PypeServer Documents\Preprocessors"
If your users wish to "Keep preprocessed files after import" then the users will need write access writes to the folder containing the import file.