You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Esa Heikkinen <es...@student.tut.fi> on 2018/05/03 10:37:56 UTC

RE: use of values of previously accepted event

Hi

Thanks for the reply.

I have tried to understand IterativeCondition, but I have not yet fully understood. How can it apply to my case ?

If I have more (than one) variables to set (and read) in pattern, is that possible by IterativeCondition ?

Are there exist more examples how to use it ? or documentation ?

Or should I use some other method than CEP, because my case is more batch processing than stream processing ?

Best, Esa

From: Dawid Wysakowicz <wy...@gmail.com>
Sent: Thursday, May 3, 2018 12:54 PM
To: Esa Heikkinen <es...@student.tut.fi>
Subject: Re: use of values of previously accepted event

Hi Esa,
You cannot just simply assign value to some variable and read it in another pattern.
It is possible though to access event accepted in one pattern in next ones of the sequence via IterativeCondition[1].

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/libs/cep.html#conditions-on-properties

pon., 30 kwi 2018 o 12:48 Esa Heikkinen <es...@student.tut.fi>> napisał(a):
Hi

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 ?

Best, Esa

From: Esa Heikkinen
Sent: Thursday, April 26, 2018 3:18 PM
To: user@flink.apache.org<ma...@flink.apache.org>
Subject: RE: use of values of previously accepted event

Hi

Or is it possible to use global or local variables inside in pattern sequence ?
And how (by Scala) ?

Best, Esa

From: Esa Heikkinen <es...@student.tut.fi>>
Sent: Wednesday, April 25, 2018 4:16 PM
To: user@flink.apache.org<ma...@flink.apache.org>
Subject: CEP: use of values of previously accepted event

Hi

I have tried to read [1] 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:

1.       Search event A and read its value: B (that can also be different, like C)

2.       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 structure.

The pattern structure of list, tree or DAG is not known before processing, but during (and after) the processing.. Is that problem ?

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/libs/cep.html

Best, Esa

RE: use of values of previously accepted event

Posted by Esa Heikkinen <es...@student.tut.fi>.
That would be enough, but I would appreciate the full source (Scala) code examples of using IterativeConditions.

How to find correct imports for getEventsForPattern ?

Best, Esa

From: Dawid Wysakowicz <wy...@gmail.com>
Sent: Thursday, May 3, 2018 2:53 PM
To: Esa Heikkinen <es...@student.tut.fi>
Subject: Re: use of values of previously accepted event

Unfortunately you cannot set any parameters in the pattern that will be accessible in further patterns in any way. With IterativeConditions you can only access accepted events so far.

czw., 3 maj 2018 o 12:38 Esa Heikkinen <es...@student.tut.fi>> napisał(a):
Hi

Thanks for the reply.

I have tried to understand IterativeCondition, but I have not yet fully understood. How can it apply to my case ?

If I have more (than one) variables to set (and read) in pattern, is that possible by IterativeCondition ?

Are there exist more examples how to use it ? or documentation ?

Or should I use some other method than CEP, because my case is more batch processing than stream processing ?

Best, Esa

From: Dawid Wysakowicz <wy...@gmail.com>>
Sent: Thursday, May 3, 2018 12:54 PM
To: Esa Heikkinen <es...@student.tut.fi>>
Subject: Re: use of values of previously accepted event

Hi Esa,
You cannot just simply assign value to some variable and read it in another pattern.
It is possible though to access event accepted in one pattern in next ones of the sequence via IterativeCondition[1].

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/libs/cep.html#conditions-on-properties

pon., 30 kwi 2018 o 12:48 Esa Heikkinen <es...@student.tut.fi>> napisał(a):
Hi

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 ?

Best, Esa

From: Esa Heikkinen
Sent: Thursday, April 26, 2018 3:18 PM
To: user@flink.apache.org<ma...@flink.apache.org>
Subject: RE: use of values of previously accepted event

Hi

Or is it possible to use global or local variables inside in pattern sequence ?
And how (by Scala) ?

Best, Esa

From: Esa Heikkinen <es...@student.tut.fi>>
Sent: Wednesday, April 25, 2018 4:16 PM
To: user@flink.apache.org<ma...@flink.apache.org>
Subject: CEP: use of values of previously accepted event

Hi

I have tried to read [1] 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:

1.       Search event A and read its value: B (that can also be different, like C)

2.       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 structure.

The pattern structure of list, tree or DAG is not known before processing, but during (and after) the processing.. Is that problem ?

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/libs/cep.html

Best, Esa