Specifications

To successfully complete processing of a job, the script must call exactly one sendTo() function
for each generated output file/folder (i.e. there may be multiple sendTo() calls for the same job).
If there is no output, the script must call the sendToNull() function. It is allowed to defer these
calls to a subsequent entry point invocation (for example, when grouping multiple incoming
jobs in a job folder).
If a fatal error occurs, the script must call one of the fail() functions as appropriate. Calling a fail()
function cancels any and all previous sendTo() function calls for the same job during the same
entry point invocation.
Once a fail() function has been called for a job, any further calls to fail() or sendTo() functions
for the same job during the same entry point invocation are ignored (such calls just log a warning
message rather than performing the requested operation).
Guidance to generating output jobs
Guidance on generating output jobsUse Case
To deliver multiple output jobs triggered by or associated with an incoming job,
repeatedly call the sendTo() function on the input job rather than using the
One to
many
createNewJob() function; this ensures that all output jobs correctly inherit the job
ticket of the originating job
This guideline holds even if the output job is a totally different file; for example,
a preflight report for a PDF file or a file selected from a database depending on the
contents of an incoming xml file
Leave jobs in the input folder (by not calling any sendTo() functions) until you have
everything to generate a complete output job; then call sendTo() on the “primary”
Many to
one
input job and sendToNull() on all other input jobs related to this output job – all
in a single entry point invocation
The output job inherits only the job ticket of the primary input job; if this is
unacceptable you’ll have to merge metadata from the other input jobs in a
meaningful way (similar to the built-in job assembler)
In most situations this is simply a combination of the previous two use casesMany to
many
However if it is not possible to generate all output jobs during the same entry point
invocation, you need to call setAutoComplete(false) on the input job so that it is
not automatically removed from the input folder at the end of the entry point
invocation; this is an extremely rare situation so in most cases you don’t need to
worry about preventing auto-completion
You need the createNewJob() function only when there really is no originating job,
for example when you eject a new output file based on a timer or an external
event that is not associated with a job already in the flow
None to
any
Whenever you’re ready with an input job, call sendToNull() on itAny to
none
SendTo functions
In their “path” argument the sendTo() functions expect to be passed the absolute path of the
file or folder that should be sent along. This could be any path:
The path of the incoming job file/folder as returned by Job.getPath().
466
Enfocus Switch 10