Developing Apama Applications > Developing Apama Applications in EPL > Getting Started with Apama EPL > Introduction to Apama Event Processing Language
Introduction to Apama Event Processing Language
EPL is a flexible and powerful Java-like ”curly-brace” domain-specific language designed for writing programs that process events. In EPL, an event is a data object that contains a notification of something that has happened, such as a customer order was shipped, a shipment was delivered, a sensor state change occurred, a stock trade took place, or myriad other things. Each kind of event has a type name and one or more data elements (called fields) associated with it. External events are received by one or more adapters, which receive events from the event source and translate them from a source-specific format into Apama’s internal canonical format. Derived events can be created as needed by EPL programs.
Though it contains many of the familiar constructs and features found in general-purpose programming languages like Python or Java, EPL also has special features to make it easy to aggregate, filter, correlate, transform, act on, and create events in a concise manner. Here is the canonical "hello world" example written in EPL:
monitor HelloWorld
{
   action onload()
   {
      print "Hello world!";
   }
}
The Apama event processor, called the correlator, receives events of various types from external sources. EPL programs, called monitors, have registered event handlers, called listeners, for events of particular types with specific combinations of data values or ranges of values. When a listener detects an event of interest, it triggers a particular action. If there are no listeners for an event, the correlator either discards it or passes it to a listener specifically for events that have no handler.
Event handlers in EPL are conceptually similar to methods or functions used for handling user-interface events in other languages, such as Java Swing or SWT applications. In EPL, the correlator executes code only in response to events.
The correlator is capable of looking for hundreds of thousands of different events or different event patterns concurrently. When you write an EPL application, you write a set of monitors and then you inject or load these monitors into a running correlator. As streams of events pass into a correlator, the monitors and their listeners watch for the events or patterns of events that you identified in your monitors. There are a variety of actions that you can specify that you want the correlator to perform when a listener detects an event or event pattern of interest. The most common action is to generate and dispatch a message to an external receiver.
EPL is case-sensitive.
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.