hi everyone
need a bit more help here. im currently attempting to write some rules into my rulesbase and can't seem to get the system to check if a variable is empty. i have tried using null as shown in the code below
rule "small beak + small body + garden"
when
Beak(beak == "small beak", beak = null) &&
Body(body == "small body")
Location(location == "garden")
then
ES.resultsmx("<p><a href=");
ES.resultsmx("http://www.rspb.org.uk/birds/guide/r/robin/index.asp");
ES.resultsmx(">Robin</a></p>");
ES.resultsop();
end
which dosent work but for some reason i am able to check if it is not null by doing this
rule "small beak + small body + garden"
when
Beak(beak == "small beak", beak != null) &&
Body(body == "small body")
Location(location == "garden")
then
ES.resultsmx("<p><a href=");
ES.resultsmx("http://www.rspb.org.uk/birds/guide/r/robin/index.asp");
ES.resultsmx(">Robin</a></p>");
ES.resultsop();
end
can anyone help me please. Also if anyone has any knowledge of how to write rules so it only outputs one result instead of repeatedly running the conditions and outputting results for each correct condition and also how to check if a string variable contains a substring (within a rule) that would be greatly appreciated . Thanks in advance
mike