7.4 Job Object

Contains information about a given job in the queue and allows you to manipulate it.

7.4.1 ClientConnectionId property

Contains the connection ID of the client that submitted the job.

Syntax

object.ClientConnectionId

Type

Long.

Attributes

Read-only.

Example

This example contains the connection ID of the client that submitted the next job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.ClientConnectionId) 
Wend

7.4.2 ClientTaskId property

Contains the task ID of the client that submitted the job.

Syntax

object.ClientTaskId

Type

Long.

Attributes

Read-only.

Example

This example contains the task ID of the client that submitted the next job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.ClientTaskId) 
Wend

7.4.3 CreationDate property

Contains the creation date of the job.

Syntax

object.CreationDate

Type

Date.

Attributes

Read-only.

Example

This example contains the creation date of the next job in the queue Sample_Jib_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.CreationDate) 
Wend

See Also

7.4.4 Description property

Sets or returns the description of the specified Job object.

Syntax

object.Description[=Desc As String]

Type

String.

Attributes

Read/write.

Remarks

Desc is an optional parameter that sets the description of the Job object.

Example

This example returns the description of the next job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.JobName & ": " & Job.Description) 
Wend

7.4.5 EntryOpen property

Specifies whether or not the job is ready to be processed.

Syntax

object.EntryOpen

Type

Boolean.

Attributes

Read-only.

Remarks

When the job entry is created, this flag is set to indicate that the job has not yet been submitted. When the client submits the job, this flag is cleared.

Example

This example intimates whether the job in the queue Sample_Job_Queue is ready for processing. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & " Entry Open " & Job.EntryOpen) 
Wend

7.4.6 FileName property

Sets or returns the name of a file that corresponds to the specified Job object.

Syntax

object.FileName

Type

String.

Attributes

Read-only.

Example

This example returns the name of the file that corresponds to the next job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Print("A List of Job Files") 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName) 
Wend

See Also

7.4.7 JobFile property

Returns the File I/O object that corresponds to the specified job. This can be used to read the data from–or write it to–the job file.

Syntax

object.JobFile

Type

File.

Attributes

Read-only.

Example

This example returns the File I/O object that corresponds to the specified job present in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Set Job = Jobs.Element(JobNumber) 
JobFile = Job.JobFile

7.4.8 JobName property

Sets or returns the name of a job.

Syntax

object.JobName[=JobName As String]

Type

String.

Attributes

Read/write.

Remarks

JobName is an optional parameter that sets the name of a job.

Example

This example returns the name of the jobs queued in the Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Print("A List of Job Names") 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.JobName) 
Wend

7.4.9 JobNumber property

Returns the job number of the specified Job object.

Syntax

object.JobNumber

Type

Long.

Attributes

Read-only.

Example

This example returns the job number of the next job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.JobNumber) 
Wend

7.4.10 JobServerId property

Sets or returns the ID of the job server.

Syntax

object.JobServerId[= Value As Long]

Type

Long.

Attributes

Read/write.

Remarks

Value is an optional parameter that sets the ID of the job server.

Example

This example returns the ID of the job server. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.JobServerId) 
Wend

7.4.11 JobServerTaskId property

Contains the task ID of the job server.

Syntax

object.JobServerTaskId

Type

Long.

Attributes

Read-only.

Example

This example returns the task ID of the job server. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.JobServerTaskId) 
Wend

7.4.12 JobSize property

Returns the size of the specified Job object, in bytes.

Syntax

object.JobSize

Type

Long.

Attributes

Read-only.

Example

This example returns the size (Bytes) of the next job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.JobSize) 
Wend

7.4.13 JobType property

Sets or returns the type of the specified Job object.

Syntax

object.JobType[=JobType As Long]

Type

Long.

Attributes

Read-only.

Remarks

JobType is an optional parameter that sets the type of the specified job.

The JobType value depends on the job server and client. JobType is a number that tells the job server what type of job is represented by the job entry. A job server can request specific job types from a queue when making a request to service a job. The JobType is a value agreed upon by the client and the job server. For example, JobType could be used to signal which paper tray to use in a printer.

See Section A.28, Queue Constants.

Example

This example returns the type of the next job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.JobType) 
Wend

7.4.14 OperatorHold property

Specifies whether or not the job will be processed, as specified by an operator.

Syntax

object.OperatorHold

Type

Boolean.

Attributes

Read-only.

Remarks

If the flag is set, the job will not be processed until the flag is cleared, but the job continues to advance toward the front of the queue. Only operators can modify this flag.

Example

This example returns the operator hold value corresponding to the job processing status in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & " Operator hold: " & Job.OperatorHold) 
Wend

7.4.15 Position property

Sets or returns the position of the job in the queue.

Syntax

object.Position[=JobPosition As Long]

Type

Long.

Attributes

Read/write.

Remarks

JobPosition is an optional parameter that sets the position of the job in the queue.

Example

This example returns the position of the job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.Position) 
Wend

7.4.16 QueueId property

Contains the ID of the queue to which the specified job belongs.

Syntax

object.QueueId

Type

Long.

Attributes

Read-only.

Example

This example returns the queueID of the next job.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & ": " & Job.QueueId) 
Wend

7.4.17 ServiceAutostart property

Specifies how to handle the job if the client loses its connection before submitting the job.

Syntax

object.ServiceAutostart

Type

Boolean.

Attributes

Read-only.

Remarks

If this bit is set, the job is serviced after the connection of the queue server is broken, even if the client has not cleared the EntryOpen bit. If the EntryOpen bit is cleared when a server connection is broken, queue management system (QMS) removes the job from the queue.

Example

This example prints the current value of ServiceAutostart.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & " Service Autostart " & Job.ServiceAutostart) 
Wend

7.4.18 ServiceRestart property

Specifies how to handle the job if the queue server fails during processing.

Syntax

object.ServiceRestart

Type

Boolean.

Attributes

Read-only.

Remarks

The job remains in the queue (in its current position) when a queue server fails. If this bit is cleared, queue management system (QMS) removes the job from the queue when a server fails.

Example

This example prints the current value of ServiceRestart.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & " Service Restart " & Job.ServiceRestart) 
Wend

7.4.19 UserHold property

Specifies whether or not the job will be processed, as specified by a user.

Syntax

object.UserHold

Type

Boolean.

Attributes

Read-only.

Remarks

If the flag is set, the job will not be processed until the flag is cleared. However, the job will continue to advance toward the front of the queue. An operator (or the client who submitted the job) can modify this flag.

Example

This example contains the current value of the UserHold property.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Jobs.Reset 
While(Jobs.HasMoreElements) 
     Set Job=Jobs.Next 
     print(Job.FileName & " User hold: " & Job.UserHold) 
Wend

7.4.20 Close method

Closes an open job and removes it from the queue.

Syntax

object.Close()

Parameters

None.

Return Values

Boolean. Returns TRUE if successful; otherwise, FALSE.

Example

This example closes the job that was open (notice the Open method two lines before) and removes it from the queue in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Set Job=Jobs.Open(jobType) 
print(Job.JobName) 
Job.Close

7.4.21 Post method

Posts the current job for the service.

Syntax

object.Post()

Parameters

None.

Return Values

Boolean. Returns TRUE if successful; otherwise, FALSE.

Remarks

This method must be called after the Create method.

Example

This example posts the current job for the service. Notice that Post is not called until after Create has been called.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Job=Jobs.Create 
Job.Post

See Also

7.4.22 Update method

Updates the changes of the actual job queue entry.

Syntax

object.Update()

Parameters

None.

Return Values

Boolean. Returns TRUE if successful; otherwise, FALSE.

Example

This example updates the changes of the actual job queue entry in the queue in the queue Sample_Job_Queue. Ensure that the specified queue is existing.

Set Queue = CreateObject("ucx:Queue") 
Queue.Name = "Sample_Job_Queue" 
Set Jobs = Queue.Jobs 
Set Job=Jobs.Element(jobNumber) 
job.description = "This description is being set through NSN" 
job.Update 
Job.Close