#include <nwqms.h> or #include <nwcalls.h>NWCCODE N_API NWCloseFileAndStartQueueJob (NWCONN_HANDLE conn, nuint32 queueID, nuint32 jobNumber, NWFILE_HANDLE fileHandle);
jobNumber contains the job number returned by QMS when the job was originally entered in the queue.
NWCloseFileAndStartQueueJob2 closes the file associated with the job and resets QF_ENTRY_OPEN in jobControlFlags.
jobControlFlags bit definitions follow:
Bit | Flag Name | Description |
---|---|---|
0x08 | Auto Start | Specifies how to handle the job should the client station lose its connection before submitting the job. If this bit is set, the job is serviced after a queue server connection is broken, even if the client has not cleared the Entry Open bit. If the bit is cleared when a server connection is broken, QMS removes the job from the queue. |
0x10 | Service Restart | Specifies how to handle the job if the queue server fails during processing. The job remains in the queue (in its current position) when a queue server fails. If this bit is cleared, QMS removes the job from the queue when a server fails. |
0x20 | Entry Open | Specifies whether the job is ready to be processed. When the job entry is first created, this flag is set to indicate the job has not been submitted yet. When the client submits the job, this flag is cleared. NWCloseFileAndStartQueueJob2 clears this bit (marking the job ready for service) if the User Hold and Operator Hold bits are cleared. |
0x40 | User Hold | Specifies whether the job may be processed. If the flag is set, the job will not be processed until the flag is clear, but the job continues to advance toward the front of the queue. An operator or the client who submitted the job can modify this flag. |
0x80 | Operator Hold | Specifies whether the job may be processed. If the flag is set, the job will not be processed until the flag is clear, but the job continues to advance toward the front of the queue. Only operators can modify this flag. |
--------------------------------------------------------- | Bit | Flag Name | Description | |-----|-----------------|--------------------------------| | 0x08| Auto Start | Specifies how to handle the | | | | job should the client station | | | | lose its connection before | | | | submitting the job. If this | | | | bit is set, the job is | | | | serviced after a queue server | | | | connection is broken, even if | | | | the client has not cleared the| | | | Entry Open bit. If the bit is | | | | cleared when a server | | | | connection is broken, QMS | | | | removes the job from the | | | | queue. | |-----|-----------------|--------------------------------| | 0x10| Service Restart| Specifies how to handle the | | | | job if the queue server fails | | | | during processing. The job | | | | remains in the queue (in its | | | | current position) when a queue| | | | server fails. If this bit is | | | | cleared, QMS removes the job | | | | from the queue when a server | | | | fails. | |-----|-----------------|--------------------------------| | 0x20| Entry Open | Specifies whether the job is | | | | ready to be processed. When | | | | the job entry is first | | | | created, this flag is set to | | | | indicate the job has not been | | | | submitted yet. When the client| | | | submits the job, this flag is | | | | cleared. | | | | NWCloseFileAndStartQueueJob2 | | | | clears this bit (marking the | | | | job ready for service) if the | | | | User Hold and Operator Hold | | | | bits are cleared. | |-----|-----------------|--------------------------------| | 0x40| User Hold | Specifies whether the job may | | | | be processed. If the flag is | | | | set, the job will not be | | | | processed until the flag is | | | | clear, but the job continues | | | | to advance toward the front of| | | | the queue. An operator or the | | | | client who submitted the job | | | | can modify this flag. | |-----|-----------------|--------------------------------| | 0x80| Operator Hold | Specifies whether the job may | | | | be processed. If the flag is | | | | set, the job will not be | | | | processed until the flag is | | | | clear, but the job continues | | | | to advance toward the front of| | | | the queue. Only operators can | | | | modify this flag. | |-----|-----------------|--------------------------------|
The specified job is ready for execution when (1) NWCloseFileAndStartQueueJob2 finishes, (2) QF_USER_HOLD and QF_OPERATOR_HOLD are both cleared, and (3)
targetExecutionTime
in NWQueueJobStruct either has not been specified or has elapsed.
Only the workstation that created the job can call NWCloseFileAndStartQueueJob2.
Queue Management