I got it to work using eval like so
when
...
eval($mycontext.isNotSubset("STRING1", "STRING2","STRING3", "STRING4"))
I have the logic in isNotSubset method in context class to check if the set
the context is subset of array passed in the call to the method.
This works but I believe this c
Wolf, in my case the superset in the rule is hard-coded in each rule. Each
rule can have different values in the set.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Check-if-fact-is-subset-of-items-in-the-rule-tp1680013p1681143.html
Sent from the Drools -
yes, Superset is defined in the rule and subset comes from the fact.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Check-if-fact-is-subset-of-items-in-the-rule-tp1680013p1681036.html
Sent from the Drools - User mailing list archive at Nabble.com.
__
Wolfgang Laun-2 wrote:
>
> You could define a new operator (similar to "contains" or "memberOf") that
> tests whether a field - a set of values - is a subset of a another set of
> values.
>
> See my home page for a full recipe: http://members.inode.at/w.laun/
>
> The code given there is for b
Digging further I found that 5.x version supports Declared Types.
However it seems that it is only limited to primitives and Classes right
now.
I got a simple sample with primitives working.
However I have a need to pass an array of string as a instance variable.
Is this possible right now?
Th
This works great for the case where all entries in fact matches all entries
in rule.
I have a case where a subset of facts can exist in the set of rule.
How would I construct the rule in this case without using the exits and from
as I did initially?
so MyContext.classes has subset "TStr1", "TSt
Esteban wrote:
>
> I must be missing something. If you want to check if all the three strings
> are present in each array, why are you using OR (||)?
>
> If you don't want to model the array as a class containing the "parent"
> reference and insert them as facts, you can try this:
>
> MyContex
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