Working with Sample Project
The Predictive Analytics plug-in package ships a sample project EnergyData available at APAMA_HOME/samples/PredictiveAnalytics/EnergyData. You can use this as a reference for using Predictive Analytics Plug-in.
It is recommended that you copy this sample folder to APAMA_WORK directory rather than running it directly from the installation directory. For Windows users with UAC enabled, this step is required to avoid access denied errors when writing to the sample directory.
Ensure that the Predictive Analytics Engine license file (zementis.license) is copied to SAG_HOME/Zementis/adapa-bundle/lib folder.
Running the sample project performs the following tasks:
Starts correlator, injects the plugin bundle, initialises the Predictive Analytics plug-in by injecting
EnergyDataSample.mon and the input is sent from
EnergyData.evt.
Apama EPL application
EnergyDataSample.mon performs the following tasks to configure the Predictive Analytics plug-in:
Creates a new
ServiceParams instance and provides details about the PMML model to be loaded.
Uses a
ServiceHandlerFactory to create a new Predictive Analytics plug-in instance with the configured parameters.
Receives a callback on
onServiceInitialised with reference to the newly created
ServiceHandler after the Predictive Analytics plug-in instance is successfully created.
Forwards any requests (
SampleInput) received to the Predictive Analytics engine by creating a new
com.apama.pa.pmml.Input request.
Consumes responses (
com.apama.pa.pmml.Output) from the Predictive Analytics engine.