Developing Apama Applications > Writing Correlator Plug-ins > Introduction to Correlator Plug-ins
Introduction to Correlator Plug-ins
Although the correlator’s native programming language, the Apama Event Processing Language (EPL), has most of the functionality of modern programming languages, its primary purpose is enabling the detection of, correlation across, and triggering on complex event patterns. (Apama Event Processing Language is the new name for MonitorScript.)
In most cases existing code could be ported and rewritten in EPL, but in practice this might not be feasible. For example, an application might need to carry out advanced arithmetic operations and a significant programming library of such functions might already be available. Porting such complex code to EPL would be a lengthy, expensive and error prone task, and is unnecessary.
In order to incorporate existing specialized functionality, developers can write what is termed an event correlator plug-in. A correlator plug-in consists of an appropriately formatted library of C or C++ functions which can be called from within EPL code. In the case of a plug-in written in Java, the Java classes that are called from an application's EPL code are contained in a jar file.The event correlator does not need to be modified to enable or to integrate with a plug-in, as the plug-in loading process is transparent and occurs dynamically when required.
Custom correlator plug-ins can be developed using Apama’s EPL Plug-in APIs for C, C++, and Java. Once a plug-in is developed, a developer can call the functions it contains directly from EPL code, passing EPL variables and literals as parameters, and getting return values that can be manipulated.
Note: It is very important that strict plug-in development guidelines are followed when developing a plug-in. The functions provided must be adequately debugged prior to their integration within a plug-in. This is because when the event correlator loads a plug-in it is dynamically linked in with the correlator’s runtime process. If any code within the plug-in causes a runtime error the correlator might fail and terminate.
For this reason, Apama customers who experience problems with correlator stability whilst using plug-ins will be asked by Apama Technical Support to remove the plug-in and reproduce the problem prior to being offered further technical help. Apama Technical Support will only lift this restriction if the plug-ins have had prior certification by Apama.
Writing a Plug-in in C and C++ illustrates the plug-in development process through exploration of a simple example. Advanced Plug-in Functionality in C++ and C takes this further with a more comprehensive example, while The EPL Plug-in APIs for C and C++ provides a more complete overview of the functionality of the EPL Plug-in C API and the EPL Plug-in C++ API. Writing Correlator Plug-ins in Java describes the EPL Plug-in Java API.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.