[rules-users] Matching strings in two arrays
kpandey
kumar.pandey at gmail.com
Wed Sep 29 10:56:47 EDT 2010
Thomas, Thanks for the suggestions.
Swindells, Thomas wrote:
>
> Also have you tried just using ==, eg exists( String(this ==
> "TestString1") || String(this == "TestString2") || String(this ==
> "TestString3") from DclassesList)
>
This did reduce the time by about 50 ms.
Swindells, Thomas wrote:
>
>
> You may also want to consider whether it would be beneficial to
> restructure your fact class to get rid of the from, and match against
> ClassName facts instead - this may give you a big performance gain as it
> means each rule wouldn't have to iterate over the list, if you are
> updating MyContext then this gain is likely to be even bigger.
>
Not quite sure about what you mean by "match against ClassName facts instead
". My fact class will have a bunch of instance variables one of which is
the array of strings.
Would be great if you could elaborate that a bit.
Thanks again
Kumar
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Matching-strings-in-two-arrays-tp1602511p1602681.html
Sent from the Drools - User mailing list archive at Nabble.com.
More information about the rules-users
mailing list