Hi Puneet,

…  not able to answer your question, but I would be curious to also print out 
the value with your diagnostic message.
… assuming we’ll see an ‘a’ and a ‘b’ for both filters resp.

… simple explanation would be that the filters are applied to all input, 
regardless of the pattern matching that follow the input filtering (just 
guessing)

Thias


From: Puneet Duggal <puneetduggal1...@gmail.com>
Sent: Mittwoch, 27. Oktober 2021 11:12
To: user <user@flink.apache.org>
Subject: Duplicate Calls to Cep Filter

Hi,

I am facing an issue where a single event is causing execution of a cep filter 
multiple times. I went through this 
video<https://www.youtube.com/watch?v=XRyl0RGWs1M> explaining automata 
formation from pattern sequence but it still does not explain the behaviour 
that I am facing. Following is the sample pattern for which I am testing this 
behaviour.

Pattern<String, ?> innerPattern =

                Pattern

                        .<String>begin("start")

                            .where(new SimpleCondition<String>() {

                                @Override

                                public boolean filter(String value) throws 
Exception {

                                    System.out.println("In the beginning");

                                    return value.equals("a");

                                }

                            })

                        .followedBy("middle")

                            .where(new SimpleCondition<String>() {

                                @Override

                                public boolean filter(String value) throws 
Exception {

                                    System.out.println("In the middle");

                                    return value.equals("b");

                                }

                            });

On passing events a and b to this pattern.. result is

1> a

In the beginning

1> b

In the middle

In the middle

In the beginning

Matched

3> {start=[a], middle=[b]}

As you can see ... on ingestion of b middle pattern is getting called twice. 
Any ideas of this behaviour.



Thanks and regards,

Puneet Duggal
Diese Nachricht ist ausschliesslich für den Adressaten bestimmt und beinhaltet 
unter Umständen vertrauliche Mitteilungen. Da die Vertraulichkeit von 
e-Mail-Nachrichten nicht gewährleistet werden kann, übernehmen wir keine 
Haftung für die Gewährung der Vertraulichkeit und Unversehrtheit dieser 
Mitteilung. Bei irrtümlicher Zustellung bitten wir Sie um Benachrichtigung per 
e-Mail und um Löschung dieser Nachricht sowie eventueller Anhänge. Jegliche 
unberechtigte Verwendung oder Verbreitung dieser Informationen ist streng 
verboten.

This message is intended only for the named recipient and may contain 
confidential or privileged information. As the confidentiality of email 
communication cannot be guaranteed, we do not accept any responsibility for the 
confidentiality and the intactness of this message. If you have received it in 
error, please advise the sender by return e-mail and delete this message and 
any attachments. Any unauthorised use or dissemination of this information is 
strictly prohibited.

Reply via email to