12 – Advanced File Archiving

IMan provides sophisticated, almost transactional control of file operations. This step will show how to use the File Task to move only those files which have been processed.

Using SYS.INPUTFILE

On any File Reader (CSV, Xml, Excel & Fixed Width Text), there is an additional field added to the dataset containing the full File Path of the File(s) against its corresponding record.

The File Task can reference and use this field to move specific files.

Actions the File task can do using the SYS.INPUTFILE field:

  • Move the Orders file from the Archive directory to its parent directory.

Archive File using sys.inputfile

  1. Open the Sage200 Order Import, click the Field Mapping tab, and press the Edit button on the Grid.
    • As per the discussion in the Order Import and the Audit sections for non-mapped fields, set the log key for the SYS.INPUTFILE to 20.

  1. Save the Grid and Close.
  2. Re-open the Archive Task.
  3. Clear the Source Directory field.
  1. Set the Source File to:
    • %[SOPOrder.SYS.INPUTFILE]

The Field must be fully referenced to include both the Transaction Id as well as the field name, and because of the dots in the field it must be enclosed in square brackets, otherwise an error will be generated.

  1. Press Refresh.
    • The file will now be moved to the Archive directory.
    • This has the same effect as the previous ‘simple’ example but in a high volume environment this will now only move files which have been processed.
  2. Press Apply to save and then close.
  1. Save the integration.
  2. Now run the integration in total from the Scheduler.
    • Just remember to move the file from the Archive folder!