Apama 10.3 | Apama Documentation | Developing Apama Applications | Developing Apama Applications in EPL | Using EPL Plug-ins | Interfacing with user-defined EPL plug-ins
Interfacing with user-defined EPL plug-ins
Although EPL is very powerful and enables complex applications, it is foreseeable that some applications might require additional specialized operations. For example, an application might need to carry out advanced arithmetic operations that are not provided in EPL. You can address this situation by writing custom EPL plug-ins using Apama's C++, Java, or Python plug-in development kits. For detailed information on developing your custom EPL plug-in, see Developing EPL Plug-ins.
Note: The correlator's plug-in interface is versioned. If you upgrade the major or minor version of Apama, you may need to recompile your plug-ins against the new libraries to be compatible with the newer version of the correlator.
In order to access a function implemented in an EPL plug-in, you must import the plug-in. If the plug-in is written in Java, you must first inject the jar file containing the plug-in. For any plug-in, an EPL monitor or event must use the import statement to load it:
import "apama_math" as math;
For a Java plug-in, this will load the plug-in from the injected jar file. For a C++ plug-in, this will look for the Apama plug-in file libapama_math.so (on Linux) or for apama_math.dll (on Windows). These must be located on the standard library path (by default, in $APAMA_WORK/lib). It will then map it to the internal alias math.
Note: Insert the import statement in the monitor that uses the plug-in functions.
If the apama_math plug-in defines a method called cos that takes a single floating point value as an argument and returns a float value, this would be called from EPL as follows:
float a, b;
// ... some other EPL
a := math.cos(b);
Standard float, integer and boolean types are passed by-value to external functions while string and sequence types (which map to native arrays in the plug-in) are passed by-reference. In addition, the chunk type can be used to "pass-through" data returned from one function call to another plug-in function, as shown in About the chunk type.

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.