[rules-users] Problem implementing multiple evals

Ayush ayush.vatsyayan at alcatel-lucent.com
Fri Jan 28 01:08:37 EST 2011



When I'm trying to execute multiple evals I'm getting errors. Below is what
I'm trying to do

          MyEvent(prop1="XYZ") over window:time(1m) from entry-point
MyStream
               or
             (MyEvent() over window:time(1m) from entry-point MyStream
                and
                Number($i1 : doubleValue)
                from accumulate(
                        MyEvent(
                        prop1 == "CONNECT",
                        prop2 == 3,
                        eval((prop3 matches ("match "+getFirstNameRegex()+"
Connect")) == true)
                        ) over window:time(1m) from entry-point MyStream,
count()
                )
                and
                eval($i1 > getNodeCount()*0.35))
        or
                (MyEvent() over window:time(1m) from entry-point MyStream
                and
                Number($i2 : doubleValue)
                from accumulate(
                        MyEvent(
                        prop1 matches "(second|Third{1}_CONNECT",
                        prop2 == 1,
                        eval((prop3 matches
("MatchOne|MatchTwo){1}::"+getMMSCNameRegex()+", failure")) == true)
                        ) over window:time(1m) from entry-point MyStream,
count()
                )
                and
                eval($i2 > getConnectionCount()*0.4))
        or
                (MyEvent() over window:time(1m) from entry-point MyStream
                and
                Number($i3 : doubleValue)
                from accumulate(
                        MyEvent(
                        prop1 matches "(E1|E2){1}_CONNECT",
                        prop2 == 3,
                        eval((prop3 matches ("REPT (one|five|seven){1}::
"+getServerID()+" is down")) == true)
                        ) over window:time(1m) from entry-point MyStream,
count()
                )
                and
                eval($i3 > getThirdNodeCount()*0.5))

When I'm trying to execute the above LHS I get 
org.drools.rule.InvalidPatternException: Required Declarations not bound:
'$i1'. 

I even tried using below approach

       AlertReceivedEvent() over window:time(1m) from entry-point
NotificationStream
               
                $I1 : Double() from getIsgNodeCount()
               
                Number(doubleValue > $I1) from accumulate(
                        AlertReceivedEvent(
                                entity == "NPMMS_NE_CONNECT",
                                probableCause == 3,
                                eval((specificProblems matches ("REPT ISG
NPMMS::Unable to connect to "+getPxmmsNameRegex()+" node: PXMMS")) == true)
                        ) over window:time(1m) from entry-point
NotificationStream, count()
                )


But when I'm placing parentheses () around it, it throws exception stating
mismatched input '$I1' expecting ')' in rule. For now I'd placed these 3
statements in separate rules. Can anyone please help me solving it?  Thanks
in advance.
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Problem-implementing-multiple-evals-tp2365761p2365761.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list