OptEngine Class Properties

This section lists the optimization properties for the OptEngine PeopleCode class. The properties are listed in alphabetical order.

Description

The DetailMsgs property returns a list of messages generated by an optimization engine. Use DetailMsgs after you use the RunAsynch and RunSynch methods to check the status messages for an optimization transaction.

If the transaction fails, detailed messages are automatically shown to the user. If the transaction succeeds, warnings and informational messages may be generated by the transaction. Use this property to retrieve those messages and make them available to the user.

DetailMsgs provides a two-dimensional array containing the message set ID, the message number in the message catalog, and any arguments. Each row in the two-dimensional array has the following structure:

  1. Message set ID.

  2. Message number.

  3. Number of message arguments.

  4. Argument1.

  5. Argument2.

  6. Argument3.

  7. Argument4.

  8. Argument5.

A maximum of five arguments is supported for each message.

Note: To hold the property value returned, you need to declare an array of array of type Any.

Note: Before this method is called, you must call CreateOptEngine or GetOptEngine.

Example

Local OptEngine &myopt;
Local integer &status;
Local string &piid;

Local string &string; 
Local array of array of any &arrArray;
 
&NEWLINE = Char(10);
&string = "";

&piid = GetRecord(Record.PSOPTPRBINST).GetField(Field.PROBINST).Value;
&myopt = GetOptEngine(&piid);

&status = &myopt.RunSynch("TEST_TRANSACTION");

If (&status = %OptEng_Success) then

&arrArray = &myopt.DetailMsgs;
For &iloop = 1 To &arrArray.Len
 
   &string = &string | &NEWLINE | MsgGetText(&arrArray [&iloop][1] /*message set*
/, 
   &arrArray [&iloop][2] /*message id*/, "Message Not Found",&arrArray[&iloop][4], 
   &arrArray [&iloop][5],&arrArray [&iloop][6],
&arrArray [&iloop][7],&arrArray[&iloop][8]);

End-For;

GetLevel0().GetRow(1).GetRecord(Record.QE_FUNCLIB_OPT).DESCRLONG.Value = &string;
End-If;

Description

The DetailedStatus property contains the detailed execution status of an OptEngine method after the method is executed.

Example

Local integer &status;
&status = myopt.ShutDown();
if &status=%OptEng_Fail and &myopt.DetailedStatus=%OptEng_Method_Disabled then
   <perform some action>
End-if;