0

I try to remove Events between two distinct events.

I've found a way to declare a dynamic context, which meets the situation in which I want to remove the events.

create objectarray schema ParentEvent(Start Bool,End Bool)
create objectarray schema ChildEvent() inherits ParentEvent

create context RemoveContext initiated by ChildEvent(Start) terminated by ChildEvent(End)

I simply cant figure out, how to construct a output stream or Window? which holds only all the other ParentEvent that are not in the context.

The way I insert the Events in my OutputStream:

insert into MyStream.out select * from ParentEvent(Start or End)
Bernhard
  • 1
  • 1
  • Need a little more info to help answer. Please add example events that are added and flag those events that you expect to see. – Dakotah North Sep 07 '22 at 12:26

1 Answers1

0

So lets say there are 5 events A B C D E F and you want to output all events between B and E. The EPL is:

create context BetweenCandEContext start B end E;
context BetweenCandEContext select * from Event;

So the context defines the start and end criteria.

In your case, in order to "remove events", meaning not process events, that means your end criteria is the criteria when you start "removing events" and your start criteria is when you want to stop "removing events".

I suggest, instead of thinking as "removing events" --- think of it as ignoring events, since when events arrive they ignored (and not removed).

user3613754
  • 816
  • 1
  • 5
  • 5
  • The Problem is, I don't know how to ignore the events apart from stopping the statement. I continually insert the events in the stream I want to forward to another application. How do I "ignore" the Events happening during the context? – Bernhard May 11 '22 at 13:51
  • It's more like vice versa: I want to output from Application start all events until the context happens. During the context, I don't want to output events. If the context closes, I want to output the events again. – Bernhard May 11 '22 at 14:00
  • If I want to negate the context to be always open until the ChildEvent(Start)....ChildEvent(End) happens, I need a way of saying "start [from beginning] or ChildEvent(End) end ChildEvent(Start)" – Bernhard May 11 '22 at 14:25