[rules-users] How to call a function in when statement?

luqman lgsahaf at gmail.com
Mon Jul 1 09:33:48 EDT 2013


I am using Drools. I was using a function to check a condition and I'm facing
this problem:
When I call the function without using an input argument, then it works
fine. However, when I use the function using an argument, then it fails and
the program gives the following error:

Exception in thread "main" [Error: *unable to resolve method using
strict-mode:* rbs.RBS.checkTopology(java.lang.Object)]
[Near : {... RBS.checkTopology($alarm.getProper ....}]


The rule is:

rule "R_LOS"
when
   
$alarm:Alarm(properties.get("nativeProbableCause")=="R_LOS",properties.get("perceivedSeverity")!="PS_CLEARED",*/RBS.checkTopology($alarm.getProperties.get("nativeEMSName")/*
) )
then
    System.out.println($alarm.getProperties().get("perceivedSeverity"));
end

The function I'm using RBS.checkTopology(String name). Remember, that when I
don't pass the argument I change the function prototype too!

Kindly, help me out with this!!!




--
View this message in context: http://drools.46999.n3.nabble.com/How-to-call-a-function-in-when-statement-tp4024685.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list