Monitoring Job Status

The _sys_ClientJobMonitor job variable enables you to monitor job status synchronously as the job is running. The values are TRUE or FALSE. The default value is FALSE. For example:

   <pfjob:var name="_sys_ClientJobMonitor">true</pfjob:var>

When Pageflex Server receives this command packet on the specified port, it keeps the client socket connection open, and sends a response code with the transaction ID for the socket followed by a carriage return and line feed. For example:

   R0000000: T1234567<CRLF>

Following this response code, Pageflex Server reports over this socket job status messages from Pageflex Server.

Note:    Server will not be expecting any incoming traffic on this socket.

Messages reported to the client are in the form:

   J<number>: message here<CRLF>

Informational numbers are in the range less than 5000. Error numbers are in the range greater than 5000. For multiline messages the response code is followed by a hyphen instead of a colon, except for the last line which is followed by a colon.

The following client job monitor return codes report the job completion status:

Message

Description

J0000020

Job completed successfully.

J0000021

Job only partially completed (i.e. one of the records failed).

J0000022

Job failed.

J0000023

Job cancelled by user.

Clients using the client job monitor feature can look for these constants to determine whether Server considered the job successful or not.

Example

For the message “Evaluation failed for variable: FormatPriceJS Script result was null, line 48, column 4,” Pageflex Server returns:

   J0005000- Evaluation failed for variable: FormatPriceJS<CRLF>

   J0005000: Script result was null, line 48, column 4<CRLF>

Once the job is complete, Pageflex Server sends a final transmission and closes the socket, using the following formatting:

   J0000001: Transaction <transaction ID> ended

Here is a complete example of a client job monitor command packet:

<?xml version="1.0">

<?pf_command version="1.0"?>

<pfjob:job_command xmlns:pfjob="http://www.pageflex.com/schemas" name="SubmitJob">

<pfjob:job_variables>

<pfjob:var name="ProjectName">Sample Project.pf</pfjob:var>

<pfjob:var name="JobName">Job 1</pfjob:var>

<pfjob:var name="_sys_ClientJobMonitor">true</pfjob:var>

</pfjob:job_variables>

</pfjob:job_command>