CheckForPairingFile

Group

File Functions

Class Name

com.ebd.hub.datawizard.plugin.cron.CheckForPairingFile

Function

This file function checks the cron job directory for files with the same name but a file extension specified in the configuration file.

Configuration File

sample_pairing_file.properties

Description

The file function CheckForPairingFile (time-driven Input Agent → Other → File function class) looks for control files in the cron job folder that have the same prefix as the files matching the file pattern and the suffix that is specified in the configuration file. The path and the name of the configuration file have to be entered in the input field below the class name. See also sections Options and Phase 1.

Only if a matching control file is found, the cron job starts. Only the cron job file is processed, but not the corresponding file with the different extension.

Note: If the file pattern of the cron job finds more than one file, only the ones with matching control files are processed. Not the other ones. See examples below. This class supports SMB or local filesystems only!

Parameter Description

Parameter Name

Description

suffix

Specifies the file extension (without a dot) of the control file.

append.suffix

If the parameter is not present or has the value false, the behaviour described above applies. If the parameter has the value true, then the value of the suffix parameter is appended to the complete input file name (with original suffix) to generate the name of the expected control file. See examples below.

delete

(true or false) true to delete the control file after a job has been created.

Example

Let us assume the file pattern *.txt and the following configuration file.

sample_pairing_file.properties
suffix=csv
delete=false

If the cron job folder contains the two files test.txt and test.pdf, no job will be started. The control file is not deleted.

If the cron job folder contains the two files test.txt and test.csv, a job will be started and the file test.txt will be processed. The control file test.csv will not be processed and not deleted.

If the cron job folder contains the files test.txt, something.txt and test.csv, a job will be started and the file test.txt will be processed. The file something.txt is not processed and the control file test.csv will not be processed and not be deleted. There would also have to be a file something.csv in the directory so that the file something.txt would be processed.

Following an example of how to use parameter append.suffix. Please note the dot in parameter value suffix.


sample_pairing_file_2.properties
suffix=.csv
delete=true
append.suffix=true


If the Input Agent directory contains the two files test.txt and test.txt.csv, a job is started and the file test.txt is processed. The control file test.txt.csv is not processed but deleted.