Help
Overview
-
Enter the Event Processing Language (EPL) statements to create on the left side of the page under EPL Statements.
-
Use the middle section of the page titled Time And Events to define a time and event sequence.
-
Press the Submit button to validate and execute.
-
On the right side of the page under Output there are 2 tabs.
The first tab Output Events displays a breakdown of events received by
EPL statement listeners.
The second tab under Audit Information displays the time and events that were sent in,
the output of @Audit annotations (if any were declared)
and a line per output event that shows the statement name of the statement producing the output.
Date-Time Timestamp Format
Timestamps follow the format:
yyyy-MM-dd HH:mm:ss.SSS
For example:
2001-01-01 08:00:00.000
EPL Statements
Multiple EPL statements are separated by the semicolon (;) character.
When you submit the form the application validates and creates all statements.
The application also attaches listeners to each statement to capture output events
to be displayed.
Time And Events
The date-time value entered in the
Beginning Of Time input is the start time.
Before the application creates EPL statements, it sets the CEP engine time to the provided time.
Each instruction can either:
-
Set a new engine time.
-
Advance engine time relative to the current engine time.
-
Send an event into the engine.
Engine time is represented by a predefined long-type millisecond value
t.
Set Engine Time
To set a new engine time, enter an assignment of time
t to a string date-time value as follows:
t = "2001-01-01 08:00:00.000"
Advance Engine Time Relative to Current Time
To advance engine time relative to current engine time, enter an assignment of time
t to
t plus a time period:
t = t.plus(10 minutes 5 seconds)
Please see the "plus" date-time enumeration method and the time period parameter documentation in Esper docs
for more information.
Alternatively, you may also advance time in millisecond steps by adding milliseconds to
t:
t = t + 1000
The above example adds 1 second (1000 milliseconds) to the current engine time.
Send Event
To send an event into the engine, enter an assignment of event type name to an array of name-value pairs, as follows:
mytype = {intProperty = 0, stringProperty = 'abc'}
Please use curly braces for array and collection values, like shown here:
mytype = {stringArray = {'a', 'b'}, listProperty = {1, 2, 3}}
The tool converts array values to the given type, for example
create schema MyEvent(stringArray string[]) converts values for
stringArray to array of string.
For object-array please use
java.lang.Object[] as type.
The tools supports array values for these types as well:
java.util.Collection,
java.util.List,
java.util.ArrayList and
java.util.Vector.
To assign the value of an EPL expression evaluation to an event property, use the eval function and specify the expression string.
The next example assigns the result of the expression 5*5 to intProperty and the result of the myFunction function (assumed to be registered with the engine instance) to stringProperty.
mytype = {intProperty = eval("5*5")}
To assign a value to a
Date or
Calendar-typed event property
you may specify a string-value that contains a datetime value following one of the these formats:
- yyyy-MM-dd HH:mm:ss
- yyyy-MM-dd HH:mm:ss.SSS
- yyyy-MM-dd HH:mm:ss.SSSZ
- yyyy-MM-dd'T'HH:mm:ss
- yyyy-MM-dd'T'HH:mm:ss.SSS
- yyyy-MM-dd'T'HH:mm:ss.SSSZ
For example:
mytype = {dateOrCalendarPropertyOne = '2002-09-30 9:00:00', dateOrCalendarPropertyTwo = '2002-09-30 9:00:00.000', dateOrCalendarPropertyThree = '2002-09-30 9:00:00.000+0100'}
Nested Events
Events can be nested. Place the event properties of each nested event in curly braces. The nesting level is unlimited and nested classes are supported.
To illustrate, assume an order event that has a single order item as a nested event:
create schema OrderItem(itemId string, price double);
create schema OrderEvent(orderId string, item OrderItem);
The sample order event with a single order item is:
OrderEvent={orderId='O1', item={itemId='I1', price=100}}
For multiple nested events, use curly braces to separate each event.
In below schema each order event can have multiple order items:
create schema OrderItem(itemId string, price double);
create schema OrderEvent(orderId string, items OrderItem[]);
The sample order event with multiple order items is:
OrderEvent={orderId='O1', items={{itemId='I1', price=100}, {itemId='I2', price=50}}}
When using JavaBean-style events you must make sure that there are getters and setters for nested objects.
Output Events
After pressing Submit, the application lists output events and audit information on the right side.
Decorate your statements with
@Audit
to obtain audit output for that statement.
Preconfigured Engine Configurations
The engine provided to you always has the prioritized-execution enabled so you can use
@Priority
.