I am new in Drools-fusion. I want to write rules with following condition.
- Event data comes regularly to drools engine with two attribute named "eventId" and "state".
Ex:-
"data":{"eventId":"evet123","state":1}
- When first time event come it stores in working memory.
- After first event whatever event come that event's state check with previous event and if previous event's state is 1 and current event state is 2. so in that condition execute some function. and current event replace by previous event in working memory.
Ex:- if(Previous event state is 1 ---> Current event state is 2) then call function
Note:- eventId is not unique. Its may be same as previous event or different.
(May be length based sliding window use in this scenerio but i did not kknow how to convert this req. in rules.)
Please any drools expert guide me in this problem.