CEP two transitions to the same state

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CEP two transitions to the same state

Frank Dekervel
Hello,

I'm trying to model a FSM using the flink CEP patterns. However, there is something i can't figure out as all the documentation examples are linear (either you go to the single possible next state, either no match).

Suppose that two transitions lead from one state to two different states. I guess this is doable by just defining multiple followedBy/next on the same state.

But what about two different states that can end up in the same state (in the order / delivery example: suppose there are two different delivery methods, having a separate starting state but resulting in the same end state). It is possible to deduplicate the "delivered" state but this would lead to difficult to manage patterns when things get more complex.

Thanks!
greetings,
Frank



Reply | Threaded
Open this post in threaded view
|

Re: CEP two transitions to the same state

Till Rohrmann
Hi Frank,

at the moment it is not yet fully supported to run branching patterns. This is one thing to be added to Flink's CEP library [1].

As a workaround, you can run multiple CEP patterns, one for each path in your branching pattern, individually. Alternatively, you can try to combine events from different branches by using the or filter function. Or allows you to specify alternative filter conditions.

I hope this answers your question.


Cheers,
Till

On Wed, Sep 14, 2016 at 5:22 PM, Frank Dekervel <[hidden email]> wrote:
Hello,

I'm trying to model a FSM using the flink CEP patterns. However, there is something i can't figure out as all the documentation examples are linear (either you go to the single possible next state, either no match).

Suppose that two transitions lead from one state to two different states. I guess this is doable by just defining multiple followedBy/next on the same state.

But what about two different states that can end up in the same state (in the order / delivery example: suppose there are two different delivery methods, having a separate starting state but resulting in the same end state). It is possible to deduplicate the "delivered" state but this would lead to difficult to manage patterns when things get more complex.

Thanks!
greetings,
Frank