I am still interested in getting an answer, if anyone can help ?
If I have a pattern sequence like this:
val eventPattern = Pattern
.begin[TestData](“start”).where( // Sets variable X here //)
.followedBy(“end”).where( // Reads value of variable X here //)
How to set variable X in “start” and how to read the value of the variable X in “end” ?
Should or can I use global variables ?
Should variables be declared in TestData ? And how ?
From: Esa Heikkinen
Sent: Thursday, April 26, 2018 3:18 PM
Subject: RE: use of values of previously accepted event
Or is it possible to use global or local variables inside in pattern sequence ?
And how (by Scala) ?
I have tried to read  and understand how to get values of previously accepted event to use in current event (or pattern).
Iterative conditions (with context.getEventsForPatterns) do something like that, but it gets all previously accepter events..
How to get only last one (by Scala) ? Are there exist examples about that ?
For example, if i have consecutive patterns:
Search event A and read its value: B (that can also be different, like C)
Search the next event based on value of A, that is B, so event B is searched
This is little bit like searching links of list. It is also possible that an event can include many next events, so that means it is like tree- or DAG- pattern
The pattern structure of list, tree or DAG is not known before processing, but during (and after) the processing.. Is that problem ?