Command class | QSYS API Reference Guide
Estimated reading time: 10 minutes
Provides functionality to interact directly with a Job.
Namespace: ASNA.QSys.Expo.Model
Assembly: ASNA.QSys.Expo.Model.dll
Inheritance: Object
Constructors
Name |
Description |
Command(HttpContext, Int32) |
Initializes a new instance of the Command class for the provided HTTP context and job handle. |
Initializes a new instance of the Command class for the provided HTTP context and job handle.
Command(HttpContext, Int32)
Parameters
Type |
Parameter name |
Description |
HttpContext |
HttpContext |
The information associated with the HTTP request. |
Int32 |
jobHandle |
The identifier of the jobHandle for this command. |
Properties
Type |
Name |
Description |
JobSession |
JobSession |
Gets a reference to the JobSession for the Command. |
Boolean |
JobStarted |
Gets a value that indicates whether the Job has been started. |
Methods
Signature |
Description |
Call(String, String, String[]) |
Requests that a program be executed in the Job. If the program displays a page it will be shown in the browser. |
Call(String, String, String[], String) |
Requests that a program be executed in the Job. |
CallSilent(String, String, String[]) |
Requests that a program be executed in the Job. The caller will have to handle any input requested by the program via a display page. |
CommitJobSession() |
Store the job session in the data store. |
GetActiveDisplayFile() |
Get the active display file. |
GetCommandFromRequest(HttpContext) |
Initializes a new instance of the Command class for the provided HTTP context which should contain a JobHandle. |
GetHostFile(String, Byte[]&) |
Get a file stored at the host. |
GetLdaField(Int32, Int32) |
Gets the value stored in the Job’s Local Data Area. |
GetLdcObject(String) |
Gets the value from the Job’s Local Data Collection associated with the specified name. |
GetRequestJobHandle(HttpContext, DisplayPagesOptions) |
Get the JobHandle for the Request in the HttpContext. |
PushEndRequest() |
Invokes the EndRequest operation on the waiting blue thread program. |
PushKeyFocus(AidKeyIBM, Int16, String) |
Provides input to the blue thread program waiting for input. |
RemoveLdcObject(String) |
Removes the element from the Job’s Local Data Collection with the specified key. Removing an element increments the version of the LocalDataCollection. |
RequestShutdown() |
Send a request to the Job to terminate its processing. |
Return(String) |
Informs the Job that it should return to program execution. |
SetLdaField(Int32, Int32, String) |
Stores a value in the Job’s Local Data Area. |
SetLdcObject(String, String) |
Adds or updates an element of the Job’s Local Data Collection with the specified key. Adding an element increments the Local Data Collection version. |
StartJob() |
Starts a new Job. |
Requests that a program be executed in the Job. If the program displays a page it will be shown in the browser.
void Call(string assemblyPath, string programName, String[] parms)
Parameters
Type |
Parameter name |
Description |
String |
assemblyPath |
The path to the assembly. |
String |
programName |
The fully qualified program name to be call. |
String[] |
parms |
An array of parameters to be passed. Only strings can be passed. |
Requests that a program be executed in the Job.
void Call(string assemblyPath, string programName, String[] parms, string callbackPage)
Parameters
Type |
Parameter name |
Description |
String |
assemblyPath |
The path to the assembly. |
String |
programName |
The fully qualified program name to be call. |
String[] |
parms |
An array of parameters to be passed. Only strings can be passed. |
String |
callbackPage |
The URL, or route to the page, to transfer to after the call finishes. |
Requests that a program be executed in the Job. The caller will have to handle any input requested by the program via a display page.
WebDisplayFileProxy CallSilent(string assemblyPath, string programName, String[] parms)
Parameters
Type |
Parameter name |
Description |
String |
assemblyPath |
The path to the assembly. |
String |
programName |
The fully qualified program name to be call. |
String[] |
parms |
An array of parameters to be passed. Only strings can be passed. |
Returns
void CommitJobSession()
Store the job session in the data store.
WebDisplayFileProxy GetActiveDisplayFile()
Get the active display file.
WebDisplayFileProxy GetActiveDisplayFile()
Initializes a new instance of the Command class for the provided HTTP context which should contain a JobHandle.
Command GetCommandFromRequest(HttpContext HttpContext)
Parameters
Type |
Parameter name |
Description |
HttpContext |
HttpContext |
The information associated with the HTTP request. Request should have a JobHandle in the QueryString or the Form. |
Returns
Type |
Description |
Command |
A Command instance associated with the JobHandle. |
Get a file stored at the host.
int GetHostFile(string hostFilePath, Byte[]& fileBytes)
Parameters
Type |
Parameter name |
Description |
String |
hostFilePath |
The host file full path. |
Byte[]& |
fileBytes |
Stream size in bytes |
Returns
Gets the value stored in the Job’s Local Data Area.
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. |
Gets the value from the Job’s Local Data Collection associated with the specified name.
string GetLdcObject(string name)
Parameters
Type |
Parameter name |
Description |
String |
name |
The name whose value to get. |
Returns
Type |
Description |
String |
The value associated with the specified name. |
Get the JobHandle for the Request in the HttpContext.
int GetRequestJobHandle(HttpContext httpContext, DisplayPagesOptions dpOptions)
Parameters
Type |
Parameter name |
Description |
HttpContext |
httpContext |
The current HttpContext. |
DisplayPagesOptions |
dpOptions |
The website’s DisplayPage options, default’s to the configured options. |
Returns
Type |
Description |
Int32 |
The JobHandle found in the HttpContext Request’s QueryOption or Form. |
void PushEndRequest()
Invokes the EndRequest operation on the waiting blue thread program.
Provides input to the blue thread program waiting for input.
WebDisplayFileProxy PushKeyFocus(AidKeyIBM key, short virtualRowCol, string fieldName)
Parameters
Type |
Parameter name |
Description |
AidKeyIBM |
key |
The enumeration value defining the key the program would think was “pressed” by the user. |
Int16 |
virtualRowCol |
The virtual row and column of the control with focus when the key was “pressed”. |
String |
fieldName |
The field name of the control with focus when the key was “pressed”. |
Returns
Removes the element from the Job’s Local Data Collection with the specified key. Removing an element increments the version of the LocalDataCollection.
void RemoveLdcObject(string name)
Parameters
Type |
Parameter name |
Description |
String |
name |
The name of the element to remove. |
void RequestShutdown()
Send a request to the Job to terminate its processing.
Informs the Job that it should return to program execution.
void Return(string result)
Parameters
Type |
Parameter name |
Description |
String |
result |
The resulting string to be passed back to the Job. |
Stores a value in the Job’s Local Data Area.
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. |
Adds or updates an element of the Job’s Local Data Collection with the specified key. Adding an element increments the Local Data Collection version.
void SetLdcObject(string name, string value)
Parameters
Type |
Parameter name |
Description |
String |
name |
The name whose value to set. |
String |
value |
The value of the element. |
int StartJob()
Starts a new Job.