EnterworksDiff Pre-Processing Class

The EnterworksDiff pre-processing class orchestrates the processing of a new file and invokes the InfoLink EnterworksDiff utility to generate the delta file, which is then passed on to EnterWorks for import processing. The class is configured in the Scheduled Import and has the following configuration options, which will appear when the Define button is clicked in the Scheduled Import Detail Editor.

The arguments of the EnterworksDiff pre-processing class are as follows.

Argument

Description

Example Value

workDirectory

Work directory where the current, previous, and delta files are placed.

D:/Enterworks/shared/DiffFiles

newFileName

Name of the new source file as required by the EnterworksDiff utility.

source_new.csv

oldFileName

Name of the previous source file as required by the EnterworksDiff utility.

source_old.csv

deltaFileName

Name of the delta file generated by the EnterworksDiff utility.

source_delta.csv

statFileName

Name of the statistics file generated by the EnterworksDiff utility.

source_stat.csv

baseUrl

Base URL for the EnterworksDiff utility. The default is: http://localhost:8090/

http://localhost:8090/

scenarioName

Name of the Scenario to be used in the EnterworksDiff utility to generate the delta file.

pg_diff

targetFileName

Optional fully-qualified path and name of the delta file. This should be set if the file is being

passed to another Scheduled Import job for final processing to ensure a proper handoff. If left blank, the file will only be returned by the pre-processing to process.

D:/Enterworks/shared/ ImportSubmission/MaterialDelta.csv

When the Scheduled Import is activated, it performs the following steps:

  1. Verifies a full replacement file is available for processing. If not, the job ends with an Error.
  2. Deletes the generated files from the designated work directory from the previous run.
  3. Renames the designated new source file from the previous run in the work directory to the designated name for the old source file.
  4. Copies the new file into the designated work directory and renames it to the designated new source file name.
  5. If the previous new source file was not found in the work directory, it skips the remaining steps and return the new source file as the delta file.
  6. Launches the EnterworksDiff utility for the designated scenario and extracts the job number from the request response.
  7. Periodically retrieves the job status for the retrieved job number until a completion or error status is returned or until the designated number of minutes has elapsed.
  8. If an error status is returned or the timeout period has been exceeded, terminates the job with an error.
  9. Copies the delta file to the import directory.
  10. Retrieve the details from the source_stat.csv file and updates the Import log and job statistics.
  11. Returns the newly-copied delta file.
  12. If a file is returned by the EnterworksDiff pre-processing class, the Scheduled Import launches the specified import to load the file into EnterWorks. Otherwise the Scheduled Import job ends with an error. If there are no added, changed, or deleted records, the import file will be empty.