OptBase Application Class
This PeopleCode application class is part of the PT_OPT_BASE application package. It establishes the basic framework for developing PeopleCode that invokes the Optimization PeopleCode plug-in. To use the plug-in, you develop a application class that extends the OptBase application class. OptBase contains the following types of methods:
A set of base methods that you can extend for the purpose of handling input and output parameters.
You can use them within any method you develop that corresponds by name to a transaction in an analytic type definition. These methods apply to the parameters that are defined for the transaction in the analytic type.
A set of abstract placeholder methods that you can use to implement callback capability.
You must extend these if you designate one or more records as callback records in your analytic type definition, even if you don't add any functionality to the methods.
An abstract placeholder method, Init, that you can extend if you want to do any preprocessing before your first Optimization PeopleCode plug-in transaction runs.
Note: The analytic type definition to which these methods apply is the one that specifies this derived application class.
The CreateOptInterface function is the only optimization built-in function that you can use within an application class that you extend from the OptBase application class, or within PeopleCode that you call from that application class.
Optbase Callback Methods
PeopleSoft Optimization Framework has a built-in callback functionality when the OptInterface PeopleCode calls an Optimization PeopleCode plug-in transaction, it first determines whether you designated one or more records in your analytic type definition as callback records. For each callback record, the framework determines if any the record's database rows have been inserted, deleted, or updated since the optimization datacache was populated. If any changes have occurred, the framework propagates those changes to the datacache before invoking the transaction.
PeopleSoft provides methods that the framework uses to apply its callback functionality. In combination with the framework's callback changes, you might want to perform additional processing for your own purposes, including updating any derived data structures that are used by your optimization application. You can accomplish this by extending the callback methods and adding your own PeopleCode. Each callback method launches under different circumstances.
Note: Don't call any of these methods in your own PeopleCode. They're called automatically at the appropriate moment by PeopleSoft Optimization Framework, which enables your added functionality to run within each method.
Following is a list of the abstract callback placeholder methods documented as part of the PT_OPT_BASE:OptBase application class:
This method launches when the framework propagates to the datacache any database insertions encountered for a callback record.
This method launches when the framework propagates to the datacache any database deletions encountered for a callback record.
This method launches before the framework propagates each database update encountered for a callback record.
This method launches after the framework propagates each database update encountered for a callback record.
This method launches after the framework propagates all database deletions, insertions, and updates encountered for all callback records.
Important! If any record in your analytic type definition is designated a callback record, you must ensure that you extend all of the callback methods in your extended class, even if each extended method contains only a Return statement. Otherwise your Optimization PeopleCode plug-in will fail.