InteractiveJob class | QSYS API Reference Guide
Estimated reading time: 9 minutes
Defines the core behavior of an interactive job.
Namespace: ASNA.QSys.Runtime.JobSupport Assembly: ASNA.QSys.Runtime.dll
Constructors
Name | Description |
---|---|
InteractiveJob() | Called from constructors in derived classes to initialize the InteractiveJob class with a configuration from appsettings. |
InteractiveJob(JobConfig) | Called from constructors in derived classes to initialize the InteractiveJob class. |
InteractiveJob()
Called from constructors in derived classes to initialize the InteractiveJob class with a configuration from appsettings.
InteractiveJob()
InteractiveJob(JobConfig)
Called from constructors in derived classes to initialize the InteractiveJob class.
InteractiveJob(JobConfig)
Parameters
Type | Parameter name | Description |
---|---|---|
JobConfig | jobConfig | The configuration values for the new interactive job. |
Properties
Type | Name | Description |
---|---|---|
InteractiveJob | CurrentInteractiveJob | Gets the current web job associated with the invoking thread. |
WebDevice | Device | Gets the device associated with the job. |
ExecuteState | ExecuteState | Gets the execution status of the job. |
String | UserDeviceID | Gets or sets the User Device Identifier associated with this Job. It is typically a combination of the Users IP address and the Browser (UA) hash. |
Methods
Signature | Description |
---|---|
AcceptCommands() | Set the job in a state of accepting commands sent from the UI website. |
EndPrograms() | Deactivates all programs in the job, closes the device and calls Dispose(). |
ExecuteStartupProgram() | When overridden in a derived class, executes the first program in the job. |
GetJobSessionString(String) | Gets a string with the serialized job session. |
GetSessionValue(String) | Get a the value of a string in the website’s session. |
InitJobSessionStore(String) | Associate the JobSessionStore as belonging to the provided sessionId. |
RequestShutdown() | Requests an orderly shutdown of the job but it forcibly shuts it down if not completed after a time period. |
RequestShutdown() | Requests an orderly shutdown of the job but it forcibly shuts it down if not completed after a time period. |
RequestYellowService(String, String, String, String, String[]) | Request a service to be performed by the UI website. |
SetJobSessionString(String, String) | Sets the job session from a serialized string. |
SetProgram(String) | Records the name of the program that is currently running in the job. |
SetSessionValue(String, String) | Sets the string value in the website’s session. The value may override an existing one. |
SetUserDeviceID(String) | Sets the UserDeviceID for the first time. |
ShowPage(String, String) | Display an arbitrary page to the user. |
ShutDown() | Forcibly shuts down the job. |
Start(String, Socket, SemaphoreSlim, ConcurrentQueue<Int32>) | Starts the execution of the InteractiveJob on a newly created thread. |
string AcceptCommands()
Set the job in a state of accepting commands sent from the UI website.
string AcceptCommands()
void EndPrograms()
Deactivates all programs in the job, closes the device and calls Dispose().
void EndPrograms()
void ExecuteStartupProgram()
When overridden in a derived class, executes the first program in the job.
void ExecuteStartupProgram()
string GetJobSessionString(string sessionID)
Gets a string with the serialized job session.
string GetJobSessionString(string sessionID)
Parameters
Type | Parameter name | Description |
---|---|---|
String | sessionID | The job’s session id. |
Returns
Type | Description |
---|---|
String | A string with the serialized job session. May returns de special value *INVALIDSESSIONID. |
string GetSessionValue(string sessionKey)
Get a the value of a string in the website’s session.
string GetSessionValue(string sessionKey)
Parameters
Type | Parameter name | Description |
---|---|---|
String | sessionKey | The key of the string value to retrieve. |
Returns
Type | Description |
---|---|
String | The value of the string corresponding to the session key. Returns null if the key doesn’t exist. |
void InitJobSessionStore(string sessionID)
Associate the JobSessionStore as belonging to the provided sessionId.
void InitJobSessionStore(string sessionID)
Parameters
Type | Parameter name | Description |
---|---|---|
String | sessionID | The ID of the session serving this job. |
void RequestShutdown()
Requests an orderly shutdown of the job but it forcibly shuts it down if not completed after a time period.
void RequestShutdown()
void RequestShutdown()
Requests an orderly shutdown of the job but it forcibly shuts it down if not completed after a time period.
void RequestShutdown()
String[] RequestYellowService(string command, string parm1, string parm2, string parm3, String[] otherParms)
Request a service to be performed by the UI website.
String[] RequestYellowService(string command, string parm1, string parm2, string parm3, String[] otherParms)
Parameters
Type | Parameter name | Description |
---|---|---|
String | command | The service to be performed. |
String | parm1 | If any, the first parameter passed to the service. |
String | parm2 | If any, the second parameter passed to the service. |
String | parm3 | If any, the third parameter passed to the service. |
String[] | otherParms | If any, an array of other parameters to be passsed to the service. |
Returns
Type | Description |
---|---|
String[] | The result of the command. |
bool SetJobSessionString(string sessionID, string jobSessionString)
Sets the job session from a serialized string.
bool SetJobSessionString(string sessionID, string jobSessionString)
Parameters
Type | Parameter name | Description |
---|---|---|
String | sessionID | The job’s session id. |
String | jobSessionString | The serialized version of the contents of the new job session. |
Returns
Type | Description |
---|---|
Boolean | True if the sessionID corresponds to the job session, otherwise false. |
void SetProgram(string programName)
Records the name of the program that is currently running in the job.
void SetProgram(string programName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | programName | The name of the current program. |
void SetSessionValue(string sessionKey, string sessionValue)
Sets the string value in the website’s session. The value may override an existing one.
void SetSessionValue(string sessionKey, string sessionValue)
Parameters
Type | Parameter name | Description |
---|---|---|
String | sessionKey | The key associated with the string value to be stored. |
String | sessionValue | The string value to set. |
bool SetUserDeviceID(string initialDeviceID)
Sets the UserDeviceID for the first time.
bool SetUserDeviceID(string initialDeviceID)
Parameters
Type | Parameter name | Description |
---|---|---|
String | initialDeviceID | The initial ID. |
Returns
Type | Description |
---|---|
Boolean | true if the job’s UserDeviceID was null; otherwise false. |
string ShowPage(string outsidePage, string parameter)
Display an arbitrary page to the user.
string ShowPage(string outsidePage, string parameter)
Parameters
Type | Parameter name | Description |
---|---|---|
String | outsidePage | Route of page to be shown. |
String | parameter | Parameter to be passed. Defaults to “”. |
Returns
Type | Description |
---|---|
String | The string set when the shown page returned. |
void ShutDown()
Forcibly shuts down the job.
void ShutDown()
WebDevice Start(string jobName, Socket socket, SemaphoreSlim jobEndedSemaphore, ConcurrentQueue<int> endedJobsQueue)
Starts the execution of the InteractiveJob on a newly created thread.
WebDevice Start(string jobName, Socket socket, SemaphoreSlim jobEndedSemaphore, ConcurrentQueue<int> endedJobsQueue)
Parameters
Type | Parameter name | Description |
---|---|---|
String | jobName | The job name to be associated with this running job. |
Socket | socket | The socket used to communicate with the website providing the user interface display pages. |
SemaphoreSlim | jobEndedSemaphore | The semaphore to signal that the job has ended. |
ConcurrentQueue<Int32> | endedJobsQueue | The queue to register the ended job. |
Returns
Type | Description |
---|---|
WebDevice | The device assigned to the job. |