DPF Batch Client¶
Using the command line program DPF Batch Client —, you pass jobs interactively or from another system, for example an SAP system, to the DPF system.
Use case description
Installation and Configuration¶
DPF Batch Client is installed during the general installation process.
To pass jobs to the DPF working units, you can either specify server and port of MongoDB via -host parameter or use the -local parameter. For DPF Batch Client as of DPF 4.0.0 to work with the -local parameter, the config file for DPF Batch Client has to be changed:
-
Open the config file
dpfclient.xmlin an editor. It is located at:- Windows:
tools\bin_winnt5\dpfclient.xml - Linux:
tools/bin_linux223/dpfclient.xml
- Windows:
-
Add the following line at the same level as the
ENVIRONMENTSkey:<REST_LOCAL REST_HOST="jobclient-api" REST_PORT="4303" REST_PROTOCOL="http"/>Example - dpfclient.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <DPF> <config> <dpfclient> <COMMANDLINE FLAGS=""> <PROPERTIES> </PROPERTIES> </COMMANDLINE> <ENVIRONMENTS DB_HOST="vs2015-mak" DB_PORT="7128"/> <REST_LOCAL REST_HOST="jobclient-api" REST_PORT="4303" REST_PROTOCOL="http"/> </dpfclient> </config> </DPF>The config file is read anew every time the DPF Batch Client is called.
Call¶
To call DPF Batch Client enter the following command in the DPF environment:
dpfclient -wf <name> [parameters] [-s <prop=value>] [-f <file>]
dpfclient -wf <name> [parameters] -jobs <cfgfile>
dpfclient -h
Parameters:
-a starts the jobs asynchronously.
-clean deletes the jobs after processing.
(Only for synchronous assignment)
-cleaner deletes the jobs after processing even if an error
occurred.
(Only for synchronous assignment)
-h outputs the usage.
-protocol <type> communication protocol used.
Available values:
http => Communication with web service via http
https => Communication with web service via https
-host <host>:<port>
When using -protocol http:https:
hostname and port number of web service
without using -protocol:
hostname and port number of database connection
-jobs <cfgfile> name of the configuration file that is used for creating
many jobs with different parameters
-local copies the job files to the job directory locally instead
of using network transfer.
-logdir <dir> directory of the log file
Default: DPFLOG
-loglevel <level> log level
Available values: OFF, R, F, E, W, I, D, T
Default: I
-logname <name> name of the log file without .log
Default: dpfclient
-minfiles assigns the file only without basename.*
-protocol <prot> determines the transmission protocol when connecting via REST
Available values: http, https
-result <filename> name of result file with all parameters
-s <prop=value> sets the parameter <prop> to the value <value>
for all jobs.
-url <filename> name of output file with all DPF Tracker URLs
-v outputs more messages to the shell
-version shows the version.
-wf <name> assigns the process <name> with the jobs.
Hint - no longer supported
The -cleanup and -nodel parameters are no longer evaluated.
Parameters¶
DPF Batch Client evaluates the values of the OrigUserName, OrigHostName, Orig-AuthenticationId and OrigClientIP parameters from the runtime environment. However, the values specified with -s when calling DPF Batch Client, take priority.
The following parameters can be specified when calling DPF Batch Client:
-a¶
-a starts the jobs asynchronously and terminates DPF Batch Client after passing the data. DPF Batch Client will not wait for the job results.
The parameter is optional.
Default: Synchronous processing of the jobs
-clean¶
-clean deletes the job if no error occurred during the processing. -clean only has an effect with synchronous processing.
The parameter is optional.
-cleaner¶
-cleaner deletes the job even if an error occurred during the processing. -cleaner only has an effect with synchronous processing.
The parameter is optional.
-h¶
-h lists the available parameters of DPF Batch Client.
The parameter is optional.
-host¶
-host specifes the server and the port of the MongoDB database. By using this option, you can pass a job to a DPF system without dpfclient.xml.
The parameter is optional.
Available values: String
-
<server>:<port>The MongoDB database is running on server
<server>with port<port>.
Default: Values from dpfclient.xml
Literature - dpfclient.xml
You find more information about dpfclient.xml at Installation and Configuration above.
-jobs¶
-jobs specifies the file containing the jobs to be generated.
The parameter is optional.
Available values: String
-
<file>The file
<file>contains the jobs to be generated.
Default: none
Literature - examples
For more information, refer to use case Pass Jobs to the DPF System, section Send Jobs via Files.
-local¶
-local copies the job files locally into the job directory to avoid unnecessary file transfers with remote working units.
The parameter is optional.
Hint - dpfclient.xml
For DPF Batch Client as of DPF 4.0.0 to work with the -local command, the config file for DPF Batch Client has to be changed, refer to Installation and Configuration above.
-logdir¶
-logdir specifies the directory where DPF Batch Client generates the log file.
The parameter is optional.
Available values: String
-
<dir>The log file is generated in the
<dir>directory.
Default: data\log
-loglevel¶
-loglevel specifies the log level for DPF Batch Client.
The parameter is optional.
Available values: Enumeration
-
LOG_OFForOFFNo log messages
-
LOG_RUNorROnly start and stop messages; the identifier of these messages is
[R]. -
LOG_FATALorFLOG_RUNand fatal error messages; the identifier of these messages is[F]. -
LOG_ERRORorELOG_FATALand all errors; the identifier of these messages is[E]. -
LOG_WARNorWLOG_ERRORand all warnings; the identifier of these messages is[W]. -
LOG_INFOorILOG_WARNand info messages; the identifier of the messages is[I]. -
LOG_DEBUGorDLOG_INFOand debug messages; the identifier of these messages is[D]. -
LOG_TRACEorTLOG_DEBUGand trace messages; the identifier of these messages is[T].
Default: LOG_INFO
Large file
With LOG_TRACE, the log files become very large and, therefore, slow down the system very much. For this reason, activate this log level only very selectively and deactivate it again as soon as possible!
-logname¶
-logname specifies the base name of the log file.
The parameter is optional.
Available values: String
Default: dpfclient
-minfiles¶
-minfiles passes only the file without associated files, basename.*.
The parameter is optional.
-protocol¶
-protocol determines the transmission protocol when connecting via REST
Available values: String
-
httpThe HTTP protocol is used.
-
httpsThe HTTPS protocol is used.
-result¶
-result specifies the name of the file into which DPF Batch Client writes all job parameters at the end of the process. The format of this result file is identical to the format of the file specified by -jobs.
The parameter is optional.
Available values: String
-
<file>The file
<file>contains all parameters of the job at the end of the process.
Default: none
Hint - unicode
The result file is written UTF-8-encoded with BOM if the job file contains a BOM.
-s¶
-s sets a parameter to a value. The -s parameter can be specified several times.
The parameter is optional.
Available values: String
-
<parameter>=<value>The parameter
<parameter>is set to the value<value>.
Default: none
Hint - blanks
If the parameter or the value contains blanks itself, you have to quote it:
-s "first parameter=first value"
Example - with multiple parameters
dpfclient -wf procname -s parameter1=value1 -s parameter2=value2
-url¶
-url specifies the file to which the DPF Tracker URL of the job is written. The file is generated when the job is started so that the URL for tracking the job is available at once.
The parameter is optional.
Available values: String
<file>
The file <file> contains the DPF Tracker URL of the job.
The parameter is optional.
Default: none
-v¶
-v switches on the verbose mode. This displays the current position in the process and the file transfer in detail. This status display is only possible with synchronous processing.
The parameter is optional.
-version¶
-version shows the version of DPF Batch Client.
-wf¶
-wf specifies the name of the process in a DPF system to which DPF Batch Client passes the job.
The parameter is mandatory.
Available values: String
-
<procname>The procname
<process>will be assigned.
Default: none
Pass Jobs to the DPF System¶
Refer to use case Send Jobs to the DPF System via DPF Batch Client.
Return Codes¶
When assigning synchronously, DPF Batch Client returns 0 after all jobs have synchronous been processed by the DPF system without error. If an error occurred, DPF Batch Client returns a value higher than 0.
When assigning asynchronously, DPF Batch Client returns 0 after all jobs have asynchronous been started by the DPF system without error. If an error occurred, DPF Batch Client returns a value higher than 0.
The following table lists the possible return codes:
| No. | Return Code | Meaning |
|---|---|---|
0 |
EXIT_OK |
Successfully processed |
1 |
EXIT_SHOW_HELP |
Output usage |
2 |
EXIT_WRONG_ARGS |
Error when registering the job |
3 |
EXIT_BROKEN_TASK |
Error when parsing the command line |
4 |
EXIT_UNHANDLED_EXCEPTION |
Error in exception handling |
5 |
EXIT_NO_JOBS_STARTED |
No jobs started in DPF Batch Client |
6 |
EXIT_CANT_CONNECT |
No connection to the server |
7 |
EXIT_ERROR |
General error |
9 |
EXIT_CANCELED |
Cancellation by user |
10 |
EXIT_CANT_SUBSCRIBE |
Error when registering job |
11 |
EXIT_FILE_NOT_FOUND |
Job file not found |
12 |
EXIT_ERR_READ_FILE |
Error when reading the job file |
13 |
EXIT_ERR_WRITE_FILE |
Error when writing the result file |
14 |
EXIT_CLIENT_INCOMPATIBLE |
DPF Batch Client not compatible to the DPF server |
15 |
EXIT_NO_LICENSE |
No valid license |
Logging¶
By default, DPF Batch Client writes its log messages into data\log\dpfclient.log.
The log file's directory is specified with -logdir <directory>, the log file's name is specified with -logname <name> and the log level is specified with -loglevel <level> when calling DPF Batch Client.