-JPSName
Skip job name discovery and use the supplied name for the job processing script.
Syntax
-JPSName
filename
Description
The -JPSName
option specifies the JavaScript file to be executed to process the job. If this option exists the job name discovery script will not be executed, rather the script named herein will be used as the job processing script.
If this option is not specified, and there is no DocOrigin PI then the usual job name discovery script will be invoked.
If the option does specify a name, then the Folder Monitor (FM) processing will look for that job processing script (JPS) in the designated "script folder" . The JPS file name is the provided job name concatenated with ".wjs
". For example, if the option specified "Invoice" then the FM processing would look for a file named "Invoice.wjs
" in the folder identified by the -scriptFolder
option. If that file is found, that script will be launched and its eventual return code will determine whether FM considers the job to have succeeded or failed. The JPS can perform many, many steps. It's completely open-ended. Typically it does include a DocOrigin Merge step.
If the job processing script (JPS) file is not found, FM will revert to using $E/Default-JobProcessing.wjs
. Note that that default script has a ##include $O/JobProcessing.wjs
and so if you have created such an override file, that override script will be used.
If the data file is XML and has a DocOrigin processing instruction that includes a job=xxxxx
attribute, then this -JPSName
option will be entirely ignored. The job attribute tells FM which JPS to run.
Usage
Oftentimes a given FolderMonitor instance is used for only a single job type, e.g. only packing slip jobs are placed in the instance's watched folder. That is an ideal time to use -JPSName
. Depending on your personal taste, your -JPSName
script could still handle multiple job types. A JPS can do everything a JND can do. There would be nothing stopping your JPS' logic from briefly examining the data file and then having logic, within the one JPS, to process any of the expected possible job types. Some people prefer to factor logic out into individual files, some prefer to keep it all together, to have fewer files to maintain. The choice is yours.
See Also
Job Name Discovery
Command Line Processing
Command Options - FolderMonitor
_job Script Object