0

I am trying to build Esper EPL statements in Java.

I use the com.espertech.esper.client.soda lib for this, but I can't find a tutorial to help me.

The PatternExpressions are the only part that I need as of now.

As an example let's use the EPL:

every a=Event((a).getEventTypeCode()='E00001')

So he should trigger on every Event with the event type code E00001, we get the code by calling the getEventTypeCode Method.

How do I project this to SOM?

With:

PatternExpr pattern = Patterns.everyFilter("Event","a");

I only get:

every a=Event

(of course)

I know there is a class called "MethodInvocationStream" but I don't know how to use it. And I cannot find examples for its use.

Thanks to user650839 I found out how to add Methods via SOM. Here is a simple EPL as an SOM Object: https://i.stack.imgur.com/wFfZv.jpg EPL as SOM Object

Splitframe
  • 406
  • 3
  • 16

1 Answers1

0

One source of info is the javadoc. You could simply do the reverse and compile EPL text to a model object and inspect that. Use "epAdmin.compileEPL", the output is the same object you want to build via API.\

user650839
  • 2,594
  • 1
  • 13
  • 9
  • Hi, thanks for the answer! I read through the javadoc before, but it couldn't help me. However, your suggestion with the EPAdministrator class was very good. It gave me the insight into the structure that I needed ( after I loaded it with the Expression ). It's hard to find proper examples and tutorials for esper even in the codehouse. Thanks again! – Splitframe Jul 30 '14 at 11:55