Apama Predictive Analytics Plug-in 10.3 | Apama Predictive Analytics Plug-in Documentation 10.3 | 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 to DES_MODEL_EVENT.CHANNEL 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();

monitor.subscribe(DES_MODEL_EVENT.CHANNEL);
// 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-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.