On this Page

    _job Script Object

    To facilitate the passing of various job settings to the Job Name Discovery step and the Job Processing step, DocOriginFolderMonitor creates and maintains a JavaScript object called _job. You can access various job settings using this _job object:

    • _job.name - is the current job name as determined by the Job discovery script. (readonly)
    • _job.datafile - is the full filename of the data file being processed. This can be used if you need to open or read the file. (readonly)
    • _job.command.xx - provides access to the complete list of all DocOriginFolderMonitor command line settings. (readonly)
    • _job.options.xx - provides access to the complete list of all the attributes that were provided on the <?DocOrigin ... ?>  processing instruction, if it was provided.

    Command Line Option Access

    For example, _job.command.logfile will have the value of the current logfile name. job.command.scriptfolder will have the value of the -scriptFolder setting. etc.

    As the –parm command line option can be used multiple times, the syntax for picking up the value of a specific –parm option is as per the following example:

    In the command line: -parm=foo:bar 
    In the script: _job.command.Parmfoo (the P in Parm must be upper case).
    It is highly recommended to use -cache rather than -parm.

    Processing Instruction Access

    If your data file contains a DocOrigin processing instruction such as:

    <?DocOrigin job="jobName" target="Printer23"?> 

    Then you could reference the target attribute or whatever attribute name was used in the processing instruction via _job.options.target.

    FYI: Though _job.options properties are transferred from a JND script or from the PI to your JPS, they are NOT transferred into Merge when your JPS executes an _merge() call. In the above example, your form script could not successfully reference _job.options.target ... or any other _job.options property.