Launch a Job Instance or a Proof
Inputs: Parm1 = Job Instance UJP pathname
Parm2 = 'PROOFn', 'PREVIEWn', 'FAIL n', or empty for real launch
Returns: Launch count or <0 if error
Errors: -1 = Launch already in progress or completed
-2 = Cannot load list file
-3 = No lines in list file(s)
-4 = Cannot load job instance properties
-5 = $dns_file no longer supported on $fs_template
-6 = Invalid TOSEND queue for type of job
-7 = Voiceout files with no infobox number
-8 = Pollout files with no mailbox number
-9 = Failed to write .JCF file
-10 = Cannot write .TFS file
-11 = Invalid or missing TOSEND directory ($priority)
-12 = No fax files to send and no cover sheet
-13 = All lines in list file have been excluded
-14 = Cannot get NEXTFS number after 20 attempts
-15 = Cannot delete an FS file prior to rename
-16 = Cannot rename .TFS to .FS file
-17 = No record to send as proof
-18 = 'Cancel' in Parm2 only valid for LaunchMon
-19 = No fax files specified for 'SingleDoc' option
-21 = Missing file while building SingleDoc
-22 = Failure to load GCT while building SingleDoc
-23 = Failure to load TIF while building SingleDoc
-24 = Unable to write SingleDoc GTT file
-25 = Unable to write SingleDoc TIF file
-26 = Error parsing SingleDoc GCT file
-27 = Too many proofs attempted, override with MAX_PROOFS
-28 = WordMerge lists have different header-row field names
-29 = Error in RemoveDS
-30 = Merge/BCX field not matched in data source
-31 = Job document not found
-32 = Invalid e-mail content-type for WordMerge document
-33 = Missing .FIELDLIST file
-34 = Missing _RDSx.DOC file
-35 = Preview cannot be done after job proof or launch
-36 = Preview re-launch not in correct state
-37 = Job document has no content type and 'nofax'
-38 = Job items count (x) exceeds launch limit of y
-39 = Cannot determine Broadcast Type
-40 = Invalid $msmq_pri override
-41 = Excel list (loaded with USE_EXCEL) has no data in first column
-42 = Item number out of allocated range for open job
-43 = FSQ (x) write failed for x
-44 = Cannot open FS queue x
-45 = Failed (x) to write worker-box for delayed launch
-46 = Missing file or invalid do-not-send command
-47 = Unable to load do-not-send/whitelist file (or file empty)
-48 = Missing or invalid Custom List DLL
-49 = Unclassified exception during launch
-50 = Job status changed while processing delayed launch
-51 = List column count exceeds BCF_LIMIT (set negative value to truncate)
-52 = Invalid list file extension
-53 = Cannot launch with preconvert while proof/preconvert pending
-54 = Failed to get encoding code page for list file
-55 = Cannot write listfile for WordMerge Document Converter
-56 = WordMerge Document Converter launch folder already exists
-57 = Failed to create WordMerge Document Converter launch folder
-58 = CreateBCXVars job option not specified, but BCX vars used
-59 = Launch suppressed because JCF or $jcf already exists
-60 = Unable to access Queues database
-61 = JOB_CREATE_DISABLED defined in System, Owner or Jobtype properties
-62 = List column for destination exceeds max column count in lists
If called with an empty value in parm2, this function 'launches' a job by writing an FS file for each job item in the active list(s). On completion of the launch, a job control file (JCF) is written containing all the FS filenames written.
If called with 'PROOF' in parm2, the function launches a single FS file to transmit a proof fax or email using the data from the first item in the first list. Its FS filename is written to a JCX file instead of the JCF file. The optional 'n' value specifies the item number in the first list which is to be used as the proof item (but the proof is always sent to the proof destination, not the destination of that item).
If called with 'PREVIEW' in parm2, the function launches a single FS file to create a preview fax or email using the data from the first item in the first list. Its FS filename is written to a JCX file instead of the JCF file. The optional 'n' value specifies the item number in the first list which is to be used as the preview item.
If called with 'PREVIEW' in parm2 and conversions are specified and necessary, the function launches a single FS file into the PREPROC folder to initiate a document conversion. If the conversion is successful, the FS file is discarded and no transmission results; otherwise the FS file is retained and processed in the normal way to record the failure.
If called with 'FAIL n' in parm2, which should only be done before launch or after launch failure, the job will be launched with the numeric 'n' value on a FORCE_FAIL variable definition, and all pre-convert and pre-process operations will be suppressed. This launch may still fail if file or status errors prevent it from being processed.
The FS for document conversion is also written if a PROOF or full launch is requested on a job which has job option PreConvert and which includes documents specified for conversion but not yet converted.
If the job is scheduled for a future date/time, the launched FS files are normally written with a future date and containing $fax_send_time and $fax_send_date commands. However if a DELAY_LAUNCH job variable has a non-empty value, only a single workerbox FS is written in this way, which in turn launches the job when its process time is reached.
If an FS queue name is provided in job instance variable JOB_EMAIL_FSQ, then e-mail items in jobs with broadcast type EB or FEB1 will be written into the MSMQ queue instead of being written to FS files. One or more engines must define the same queue name in the configuration file variable COPIA_FSQ.
When called to launch a complete job, the function does not return until the launch is complete. To 'cancel' a launch, the job may be suspended in another thread or process. The FS files will continue to be written but the job status will prevent them from being transmitted.
After a failure to launch a proof, job status is set to 23 (proof failed)
After a successful launch of a proof, job status is set to 20 (proof launched, awaiting transmission).
If a job proof or full launch requires first a pre-conversion to be done, job status is set to 20 (proof launched, awaiting transmission). FFEXTERN will then re-request the proof or full launch if the conversion is successful.
Before the launch of a complete job, job status is set to 25 (launch in progress).
After a failure to launch the complete job, job status is set to 29 (launch failed or incomplete)
After all the FS files have been written, job status is set to 32 (suspended) if the job status 24 (job suspended during launch).
If any items have been launched to a queue, the job status is set to 35 (inqueue). The status reverts to 30 (active) after the trailer item written after all the job items has been removed from the queue.
Otherwise, job status is set to 30 (active).