Apama Predictive Analytics Add-on Documentation 10.0 : Working with Predictive Analytics Plug-in : Connecting Predictive Analytics Plug-in to Digital Event Services
Connecting Predictive Analytics Plug-in to Digital Event Services
1. Start Universal Messaging server.
2. Create a digital event definition for sending a PMML model using digital event service.
3. Define a byte array field in the event definition to carry PMML data. You can optionally define additional fields to store information like modelName, add/update/delete model, instanceName and so on.
4. Place the created event in APAMA_HOME/common/DigitalEventServices/TypeRepository.
You must configure the Predictive Analytics plug-in to connect to digital event service.
To configure the Predictive Analytics plug-in
1. Create a new Apama project. In the New Apama Project wizard, select the Digital Event Services bundle and Predictive Analytics Plug-in bundle.
2. In the project's config > connectivity > DigitalEventServices node, double click EventTypeList.apamades.
3. Select the digital event types to convert to Apama event definitions. Edit and save the EventTypeList.apamades file.
Software AG Designer automatically generates the EPL files containing the Apama event definitions for the selected event types in the project's autogenerated > DigitalEventTypes node.
4. In the project's config > connectivity > DigitalEventServices, double click DESConnectivity.properties file and edit the property DigitalEventServices_replaceConfigWithRNAME with realm URL to connect to Universal messaging.
5. In the sample project's monitors, LoadPmmlFromStreamSample.mon subscribes for channel DES_MODEL_EVENT and opens an event listener. Here addModelFromStream of modelManager is called to process received pmmlData.
using com.softwareag.connectivity.ConnectivityPlugins;
using DES_MODEL_EVENT;
...

ConnectivityPlugins.onApplicationInitialized();
DES_MODEL_EVENT.subscribe(); // This context will now receive digital events
// of type 'DES_MODEL_EVENT'

action onServiceInitialised(ServiceHandler servicehandler)
{
ModelManager modelmanager := serviceHandler.getModelManager();

DES_MODEL_EVENT modelEvt;
on all DES_MODEL_EVENT(instanceName=config.instanceName) :modelEvt
{
modelManager.addModelFromStream(MODEL_NAME,modelEvt.pmmlData);
}
}
6. Run the Apama project.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback