CheckOptEngineStatus method: OptEngine class
Syntax
CheckOptEngineStatus()
Description
The CheckOptEngineStatus method returns the status of the optimization engine, using a combination of its return value and the DetailedStatus OptEngine class property. Keep the following in mind:
-
The value returned by CheckOptEngineStatus is the operational status of the optimization engine.
-
The DetailedStatus property indicates the completion status of the OptEngine method call CheckOptEngineStatus.
For example, CheckOptEngineStatus can return %OptEng_Idle and DetailedStatus is %OptEng_Success. For CheckOptEngineStatus, DetailedStatus can have the value:
-
%OptEng_Success
-
%OptEng_Fail
-
%OptEng_Not_Available
Note:
Before this method is called, the CreateOptEngine or GetOptEngine must be called.
Returns
Returns an integer for the status of the optimization engine. These numbers are message IDs belonging to message set 148 in the message catalog.
| Numeric Value | Constant Value | Description |
|---|---|---|
|
21 |
%OptEng_Not_Loaded |
The optimization engine process is running, but is not currently loaded with an application problem. |
|
22 |
%OptEng_Busy_Loading |
The optimization engine is busy loading an application problem. It will not accept transaction requests until loading completes. |
|
23 |
%OptEng_Idle |
The optimization engine is loaded with an application problem and waiting for a transaction request. |
|
24 |
%OptEng_Busy |
The optimization engine is busy processing a transaction request for the loaded application problem. It will not accept additional transaction requests until the current one completes. |
|
26 |
%OptEng_Unknown |
An error has occurred. The optimization engine status cannot be determined. |
Example
This PeopleCode example shows optimization engine status being checked:
Local OptEngine &myopt;
Local string &probinst;
Local integer &status;
&myopt = GetOptEngine("PATSMITH");
/* Initialize the DESCRLONG field in the QE_FUNCLIB_OPT record to null. */
GetLevel0().GetRow(1).GetRecord(Record.QE_FUNCLIB_OPT).DESCRLONG.Value = "";
&status = &myopt.CheckOptEngineStatus();
GetLevel0().GetRow(1).GetRecord(Record.QE_FUNCLIB_OPT).DESCRLONG.Value = "Opt
Engine status = " | MsgGet(148, &status, "Could not send to the OptEngine.");
You can also retrieve the detailed status:
Local integer &detailedstatus
&status = &myopt.CheckOptEngineStatus();
&detailedstatus = &myopt.DetailedStatus;