There is an issue with following code. before A gets incremented or decremented....finalstatement gets executed. Why does this happen.. how can we manage the execution order of statements.
create variable Integer A=0;
on pattern[every a=EventCreated(a.type ='C')]
set A= A+1;
on pattern[every a=EventCreated(a.type ='EOD')]
set A= A-1;
select
"R" as type,
"R" as text,
e.time as time,
e.source as source
from EventCreated e where A=0 ;