CreateOptInterface function
Syntax
CreateOptInterface()
Description
The CreateOptInterface function instantiates an OptInterface object.
Note:
You can use this function and the OptInterface methods only within an application class that you extend from the OptBase application class, or within PeopleCode that you call from that application class. This ensures that the OptInterface PeopleCode runs only on the optimization engine.
Parameters
None.
Returns
If successful, CreateOptInterface returns an OptInterface PeopleCode object. If the function fails, it returns a null value.
Example
You declare OptInterface objects as type OptInterface. For example:
Local OptInterface &MyOptInterface;
Component OptInterface &MyOptInt;
Global OptInterface &MyOptInt;
The following example instantiates an OptInterface object:
Local OptInterface &myInterface;
Int &status;
&myInterface = CreateOptInterface(&addtionalStatus);
if (&myInterface != NULL) then
&status = &myInterface.ActivateModel("RMO_TEST");
if (&status = %OptInter_Fail) then
/* examine &myInterface.DetailedStatus for reason */
...
end-if;
else
/* CreateOptInterface has returned NULL */
/* take some corrective action here */
...
end_if;