0 Replies Latest reply on Jan 20, 2014 9:51 AM by Arun BC

    How to set rule attributes programmatically date-effective, date-expires, enabled etc

    Arun BC Newbie

      I would like to set rule attributes in the created rule. I see the class 'org.drools.rule.Rule' has setter methods to set these properties, but how can I use it to set the values in the existing rule?



      Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();

      Iterator<KnowledgePackage> kps = pkgs.iterator().next();

      org.drools.definition.rule.Rule rule = kp.getRules().iterator().next();


      org.drools.definition.rule.Rule class doesn't have methods to set attributes like the one in org.drools.rule.Rule.