www.espertech.comDocumentation

Esper Notebook Documentation

Version 9.0.0


A paragraph that contains a scenario consisting of a sequence of events and time must begin with %esperscenario.

A scenario is a list of instructions with one instruction per line. Each instruction can either:

  • Set or advance to a given time.

  • Send an event.

  • Advance time relative to the current time.

When running a paragraph that contains a scenario, the notebook performs these actions:

  1. Allocates a runtime.

  2. Sets the runtime current time.

  3. Deploys all EPL that compiled successfully.

  4. Validates and executes each instruction.

  5. Displays EPL statement output events, by default as an HTML table.

When running a scenario, the default start time is 1970-01-01 00:00:00.000 unless the scenario, in the first instruction, sets another given time.

To send an event, enter an assignment of event type name to an array of name-value pairs in curly braces. For example:

MyEvent = {intProperty = 0, stringProperty = 'abc'}

You may use curly braces for array and collection values, like shown here:

MyEvent = {stringArray = {'a', 'b'},  listProperty = {1, 2, 3}}

The scenario interpreter converts array values to the given type, for example when the event type was declared as create schema MyEvent(stringArray string[]) the interpreter converts values for stringArray to array of string. For object-array please use java.lang.Object[] as type. The interpreter 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 to stringProperty.

MyEvent = {intProperty = eval("5*5"), stringProperty = eval("myFunction('some value')")}

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 these formats:


For example:

MyEvent = {dateOrCalendarPropertyOne = '2002-09-30 9:00:00', dateOrCalendarPropertyTwo = '2002-09-30 9:00:00.000', dateOrCalendarPropertyThree = '2002-09-30 9:00:00.000+0100'}