[rules-users] Matching strings in two arrays

Vincent Legendre vincent.legendre at eurodecision.com
Wed Sep 29 11:36:59 EDT 2010


  Hi,

In your fisrt post you mentionned that the test is ti check that your 
array contains ALL 3 string.
Thus this is not a OR, but a AND

Using Thomas trick which consist in given elements as facts, you could 
use a rule that looks like this :
rule XYZ
     $p : MyContext
     ClassName(parent == $p, name == "TestString1")
     ClassName(parent == $p, name == "TestString2")
     ClassName(parent == $p, name == "TestString3")
then
     ...

and then exploiting also condition factorisation in RETE network. This 
will be even more efficient if your MyContext is the only one in WM, and 
then you can remove your condition on parent in ClassName pattern match. 
I guess that in 5000 rules, there are a lot of similar condition which 
could take avantage of such decomposition.




More information about the rules-users mailing list