Job class | QSYS API Reference Guide

Estimated reading time: 10 minutes

Defines the core behavior of a Job that provides an environment to submit, control, and keep track of Program activation and execution.

Namespace: ASNA.QSys.Runtime.JobSupport Assembly: ASNA.QSys.Runtime.dll

Inheritance: Object

Constructors

Name Description
Job() Called from constructors in derived classes to initializes the Job class with a configuration from appsettings.
Job(JobConfig) Called from constructors in derived classes to initializes the Job class with a Job Configuration.

Job()

Called from constructors in derived classes to initializes the Job class with a configuration from appsettings.

Job()

Job(JobConfig)

Called from constructors in derived classes to initializes the Job class with a Job Configuration.

Job(JobConfig)

Parameters

Type Parameter name Description
JobConfig jobConfig The configuration values for the job.

Properties

Type Name Description
String AccountingCode Gets or sets a user defined string.
ActivationGroup ActivationGroup Gets the Job’s activation group.
ActivationManager ActivationManager Gets the Job’s activation manager.
DbConnection ADO_Connection Gets the ADO connection used for ‘embedded SQL’
String ADO_ConnectionString Gets or sets the ADO Connection String.
String BatchHostFolder Gets the Folder path to the directory where the Message Files are located.
Job CurrentJob Gets the Job associated with the calling thread.
Database Database Gets the main DataGate Database associated with the Job.
String DefaultOutputQueue Gets or Sets the name of the default print Output Queue.
DocumentLibraryObject DLO Gets the Job’s document library object facility.
ExecuteState ExecuteState Always returns the State ‘Running’.
IntegratedFileSystem IFS Gets the Job’s integrated file system facility.
String JobQueueBaseQueuesPath Gets or sets the folder path root locating the job queues directory.
String JobQueueEntryExtension Gets the file extension used for job queue entries.
LocalDataCollection LDC Gets the Job’s Local Data Collection.
String MessageFileFolder Gets or sets the Folder path to the directory where the Message Files are located.
List<String> NamespaceList Gets the Namespace List for dynamic program calls
Database PrinterDB Gets the DataGate Database for Printer Files associated with the Job.
String PsdsJobName Gets or sets the Job’s Name portion of the full job name.
Decimal PsdsJobNumber Gets or sets the Job’s Number portion of the full job name. Job’s Number is unique within a Monarch Application Server.
String PsdsJobUser Gets or sets the Job’s User name portion of the full job name.
Spooler Spooler Gets the Job’s print output spooler.
DateTime StartupMoment Gets the timestamp of when the Job was started. Precision up to microseconds.
JobStats Stats Gets the Job’ Statistics. May return NULL if job has no Job Services.
JobStatus Status Gets a copy of the Job’s Status.

Methods

Signature Description
Dispose(Boolean) Releases the resources used by the current instance of the Job class.
EndPrograms() Deactivates all programs in the job and calls Dispose().
getADO_Connection() Gets the ADO connection used for ‘embedded SQL’
getDatabase() When overridden in a derived class, gets the main DataGate Database associated with the Job.
GetInvokedMessageQueue(String) Gets the message queue associated with the newest invocation of a program.
GetLdaField(Int32, Int32) Gets a value stored in the LDA.
getPrinterDB() Gets the DataGate Database for Printer Files associated with the Job.
GetSwitch(Int32) Gets the value of one of the 8 job switches.
GetSwitches() Gets a string representing the values of all 8 job’s switches.
ReclaimResources(Boolean) Reclaim the resources on the Job’s default activation group.
RetrieveSystemValue(String) Gets the value of an attribute of the current environment.
RetrieveUserProfile(String, String) Gets the name of a user.
SerializeLdaToBase64String() Converts the value of the LDA to a string representation that is encoded with base-64 digits.
SetLdaField(Int32, Int32, String) Stores a value in the LDA.
SetSwitch(Int32, Char) Sets the value of one of the 8 job switches to ‘0’ or ‘1’.
SetSwitches(String) Sets the first n job switches to the values of the characters passed in a string.
ShutDown() End the job’s execution by ending all of its active programs and disposing itself.

void Dispose(bool disposing)

Releases the resources used by the current instance of the Job class.

void Dispose(bool disposing)

Parameters

Type Parameter name Description
Boolean disposing true to release managed and unmanaged resources; false to release only unmanaged resources.

void EndPrograms()

Deactivates all programs in the job and calls Dispose().

void EndPrograms()

DbConnection getADO_Connection()

Gets the ADO connection used for ‘embedded SQL’

DbConnection getADO_Connection()

Database getDatabase()

When overridden in a derived class, gets the main DataGate Database associated with the Job.

Database getDatabase()

MessageQueue GetInvokedMessageQueue(string programQueueId)

Gets the message queue associated with the newest invocation of a program.

MessageQueue GetInvokedMessageQueue(string programQueueId)

Parameters

Type Parameter name Description
String programQueueId A string with the format ‘Relation ProgramName’. Program is a program name or ‘’ for the current program. Relation is optional, use ‘PRV’ for previous entry to Program or ‘*SAME’ for Program.

Returns

Type Description
MessageQueue If found, the message queue associated with the program; otherwise null.

string GetLdaField(int start, int length)

Gets a value stored in the LDA.

string GetLdaField(int start, int length)

Parameters

Type Parameter name Description
Int32 start The one-based index into the location within the LDA where the value is stored.
Int32 length The length in characters of the value to retrieve.

Returns

Type Description
String The requested field value.

Database getPrinterDB()

Gets the DataGate Database for Printer Files associated with the Job.

Database getPrinterDB()

char GetSwitch(int iSwitch)

Gets the value of one of the 8 job switches.

char GetSwitch(int iSwitch)

Parameters

Type Parameter name Description
Int32 iSwitch The requested switch, should be between 1 and 8.

Returns

Type Description
Char The switch value of ‘0’ or ‘1’ for the requested switch, otherwise ‘0’.

string GetSwitches()

Gets a string representing the values of all 8 job’s switches.

string GetSwitches()

void ReclaimResources(bool caller)

Reclaim the resources on the Job’s default activation group.

void ReclaimResources(bool caller)

Parameters

Type Parameter name Description
Boolean caller true to include the resource of the module’s program making this call; otherwise, false.

object RetrieveSystemValue(string sysValName)

Gets the value of an attribute of the current environment.

object RetrieveSystemValue(string sysValName)

Parameters

Type Parameter name Description
String sysValName A string with the name of of the attribute to return.

Returns

Type Description
Object The value of the attribute requested.

object RetrieveUserProfile(string keyName, string userProfileName)

Gets the name of a user.

object RetrieveUserProfile(string keyName, string userProfileName)

Parameters

Type Parameter name Description
String keyName A string with the value “RTNUSRPRF”.
String userProfileName The name of a user or the special value “*CURRENT” to get the current user.

Returns

Type Description
Object The userProfileName value or the name of the current user.

string SerializeLdaToBase64String()

Converts the value of the LDA to a string representation that is encoded with base-64 digits.

string SerializeLdaToBase64String()

void SetLdaField(int start, int length, string newValue)

Stores a value in the LDA.

void SetLdaField(int start, int length, string newValue)

Parameters

Type Parameter name Description
Int32 start The one-based index into the location within the LDA where newValue will be stored.
Int32 length The length in characters of the value to store.
String newValue The string value to store in the LDA.

void SetSwitch(int iSwitch, char value)

Sets the value of one of the 8 job switches to ‘0’ or ‘1’.

void SetSwitch(int iSwitch, char value)

Parameters

Type Parameter name Description
Int32 iSwitch The requested switch, should be between 1 and 8.
Char value ‘1’ to set switch to ‘1’, any other value sets the switch to ‘0’.

void SetSwitches(string switchesStr)

Sets the first n job switches to the values of the characters passed in a string.

void SetSwitches(string switchesStr)

Parameters

Type Parameter name Description
String switchesStr A string of up to 8 ‘1’ or ‘0’ values. Switches are assigned left to right to switches 1 up to 8. Switches with unpassed values are not modified.

void ShutDown()

End the job’s execution by ending all of its active programs and disposing itself.

void ShutDown()