[rules-users] lua

jigna jigna.chhajed at igate.com
Tue Mar 19 02:21:14 EDT 2013


Hi,

Tried writing in following ways but it gives compilation error.
I actually need to check if two( or more) errorpatterndata - patterns are
existing over particular window time.
What is the correct way to write the same?

rule "Fault" 
when 
         exists( 
                ErrorPatternData 
                ( 
                        (errorCode(=="1200007" || =="1190002" || =="1944" ||
=="2a23")) 
                ) 
	   from entry-point ErrorEntryPoint 
                && 
                ErrorPatternData 
                ( 
                        (errorCode == "76004101") 
                ) 
	   from entry-point ErrorEntryPoint 
                ) over window:time(7m)
then 
                System.out.println("Fault - Rule-Has Passed"); 
end 


When I write in folloiwng way it doesnot give compilation error, however
time window is individually applied to each one of this. which doesnot
satisfy the requirement which is to ensure that both these( or more no of)
patterns have occured in specified time window.

rule "Fault" 
when 
         exists( 
                ErrorPatternData 
                ( 
                        (errorCode(=="1200007" || =="1190002" || =="1944" ||
=="2a23")) 
                ) over window:time(7m)
	   from entry-point ErrorEntryPoint 
                && 
                ErrorPatternData 
                ( 
                        (errorCode == "76004101") 
                ) over window:time(7m)
	   from entry-point ErrorEntryPoint 
                ) 
then 
                System.out.println("Fault - Rule-Has Passed"); 
end 

tried combining two patterns as below however this too doesnot give desired
o/p.
rule "Fault" 
when 
         exists( 
                ErrorPatternData 
                ( 
                        (errorCode(=="1200007" || =="1190002" || =="1944" ||
=="2a23")) && (errorCode == "76004101")
                ) over window:time(7m)
				from entry-point ErrorEntryPoint 
                ) 
then 
                System.out.println("Fault - Rule-Has Passed"); 
end





--
View this message in context: http://drools.46999.n3.nabble.com/lua-tp4022851p4022864.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list