Send Jobs to the DPF System via DPF Batch Client¶
A job for DPF Batch Client consists of parameters, possible one or more files to be processes and the name of the process to be assigned. These settings are passed to DPF Batch Client either by parameters or in a file. The method via parameters is suitable if you want to set the same parameters for all jobs. The method via file is used if the parameters are different, if you want to pass many jobs to the DPF system at once, if you want to set many parameters or if you want to specify blanks in the file names, parameters or other values.
Hint - non-Latin-1
DPF Batch Client replaces the non-Latin-1 characters in the file name by x
and, if required, appends a running number to disambiguate it.
... via DpfSrvGetFiles
Parameter¶
In the DpfSrvGetFiles
parameter, you specify parameters containing names of any files separated by blanks. DPF Batch Client passes these files together with the job to the DPF system.
The DPF system copies the parameters to new parameters beginning with the Source
prefix.
??? Todo: Martin sagt: Bei DPF_SRV_GET_FILES werden die Dateien über REST sehr wahrscheinlich nicht korrekt übertragen. --> Schauen ob es ein Ticket dazu gibt, ansonsten testen
Example of passing files using the DpfSrvGetFiles
parameter
In a job, you want to pass file1.txt
and file2.txt
to the DPF system. The filenames are specified with the following parameters:
parameter1=file1
parameter2=file2
Set the DpfSrvGetFiles
parameter for transferring the files as follows:
dpfclient -wf procname -s "DpfSrvGetFiles=parameter1 parameter2"
DPF Batch Client passes passes both files to the DPF system. The DPF system saves the values in the following parameters:
Sourceparameter1=file1
Sourceparameter2=file2
... via File¶
If you want to set different parameters for multiple jobs, generate a file and specify this file with the -jobs
parameter when calling DPF Batch Client:
dpfclient -wf procname -jobs file
For each job to be processed, specify a section containing any parameter-value-pairs in the file. For each section, DPF Batch Client creates a job with the parameters specified in the file and passes the job to the DPF system. The format of the entry is:
[job1]
key1 = val1-1
key2 = val2-1
[job2]
key1 = val1-2
key2 = val2-1
[job3]
SourceFilename = file_for_job3
SourceAssocFilename1 = assocfile_1_for_job3
SourceAssocFilename2 = assocfile_2_for_job3
key1 = val1-3
key2 = val2-2
Rules¶
The following rules apply to the file entries:
- The section name is arbitrary and is not evaluated.
- The settings do not have to be quoted. Quotes are passed on one-to-one.
- The parameter and the value are split at the first
=
character. Leading and closing blanks are removed from the parameter and the value.
UTF-8 Encoding¶
If the file begins with a BOM, the content is taken as UTF-8-encoded, otherwise as ISO 8859-1.
To enter a BOM into a file, edit the file in Notepad and select the UTF-8
item at Encoding
in Save As
.
Transfer Files¶
If you want to transfer the <filename>
file together with a job, set the following parameter in the job section:
SourceFilename = filename
If you want to transfer associated files, assocfile<n>
, together with a job, additionally set the following parameters:
SourceAssocFileName<n> = assocfile<n>
Example¶
Example of passing jobs via file
Specifiy the job parameters for each job in jobs.cfg
:
[job1]
docid = 2836
stp = released
SourceFilename = test.tif
[job2]
docid = 9348
SourceAssocFilename1 = test3.tif
SourceAssocFilename2 = test3.hed
Pass jobs.cfg
in the -job
parameter when calling the DPF Batch Client:
dpfclient -wf procname -jobs jobs.cfg
For this example, DPF Batch Client generates two jobs. For the first job, it sets the docid
parameter to 2836
and the stp
parameter to released
. For the second one, the docid
parameter is to 9348
. For the stp
parameter, a default is used if configured.
The first job contains the test.tif
file. DPF Batch Client sets the SourceFilename<n>
parameter. The second job contains the test3.tif
and test3.hed
files.
DPF Batch Client sets the SourceAssocFilename<n>
parameter for each of these files. The SourceFilename
parameters is not set here.