[rules-users] Drool 5 memberOf problem

dxande6 dxande6 at qwest.com
Tue May 17 13:56:45 EDT 2011


I'm trying to validate that there is a Factor in a collection using the
global variable ownedProductFactorSet.  I'm having trouble.  I do not get an
error, it just doesn't resolve to true.  I've validated the
ownedProductFactor set has the Factor

Java class that is contained withing the ownedProductFactorSet:

Factor
    String key
    String value

Here is the code in the drl:

global Set ownedProductFactorSet;

rule "Owned Products"
  ruleflow-group "discount-pricing"
  lock-on-active true
  when
      not Factor(key == FactorKeys.DISCOUNT)
      String(FactorKeys.PHONE_PACKAGE memberOf ownedProductFactorSet)
      Factor(key == RulesKeys.WIRELESS)
  
  then
      logger(kcontext).info("SUCCESS - *******************************");
      insert(new Factor(FactorKeys.DISCOUNT)); end 

It never gets to the consequence (RHS - "then" part) of this rule.
If I comment out the following line:
      String(FactorKeys.PHONE_PACKAGE memberOf ownedProductFactorSet) It
will work.

Any help with the memberOf keyword is greatly appreciated.

Thanks,

-dxande6


--
View this message in context: http://drools.46999.n3.nabble.com/Drool-5-memberOf-problem-tp2953475p2953475.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list