rule-engine

Java - Generic Drools rule

╄→гoц情女王★ 提交于 2020-07-10 10:28:38
问题 I would like to create my rule more Generic format which mean it should be validate the fields and values. Following my POJO structure. public class RulesModel private String field; private List<String> values; // other stuff And my rule rule "sample" when $rule : RulesModel( field == "source", values contains "facebook", values contains "youtube", value not contains "instagram" ) then // actions end It's working fine to validate single field, but i want to validate the multiple fields of

Java - Generic Drools rule

折月煮酒 提交于 2020-07-10 10:28:04
问题 I would like to create my rule more Generic format which mean it should be validate the fields and values. Following my POJO structure. public class RulesModel private String field; private List<String> values; // other stuff And my rule rule "sample" when $rule : RulesModel( field == "source", values contains "facebook", values contains "youtube", value not contains "instagram" ) then // actions end It's working fine to validate single field, but i want to validate the multiple fields of

EqualsIgnoreCase on Drools

狂风中的少年 提交于 2020-06-18 11:16:08
问题 I am trying to rewrite my drl from using regex to equalsIgnoreCase as I think its faster. I am not sure its faster though. However, drools doesn't like it for some reason and I get unknown error. The one on top works, but the one using equalsIgnoreCase doesn't rule "name" salience 0 activation-group "flow" dialect "mvel" no-loop true when $vurderinger: Vurderinger(vurdering1909 != null && vurdering1909.verdi matches "(?i)^FOO$") then modify( $vurderinger ) { setVurdering1913(new DroolsType(

How to optimize pattern matching between different templated facts in CLIPS

╄→尐↘猪︶ㄣ 提交于 2020-01-25 08:22:47
问题 I have a rule similar to the following: (deftemplate person (slot name ( type INTEGER)) (slot surname ( type INTEGER)) ) (defrule surname_cant_be_a_name ?p1<-(person (name ?n1)) ?p2<-(person (surname ?n2&:(= ?n1 ?n2))) => (retract ?p2) ) Functionally, this works. But I run this on a huge fact-set, and the complexity gets through the roof fairly quickly. Because the rule is looking for two person objects, there's a nested for-loop kinda situation slowing the execution down. This setup goes

Creating rules programmatically in WFF

最后都变了- 提交于 2020-01-17 03:12:09
问题 i need to create rule in Windows Workflow Foundation without using RuleSet editor. Maybe i didnt search enough on google but i cant find any examle of this. Example of desired result: var ra = new List<RuleAction>(); ra.Add(new RuleAction()); var rc = new RuleCondition(); var rule = new Rule("test", rc, ra, null); Thanks ahead 回答1: I think this blog-post answers your question: Programmatically Create Windows Workflow Rules 来源: https://stackoverflow.com/questions/5350144/creating-rules

Creating rules programmatically in WFF

。_饼干妹妹 提交于 2020-01-17 03:12:06
问题 i need to create rule in Windows Workflow Foundation without using RuleSet editor. Maybe i didnt search enough on google but i cant find any examle of this. Example of desired result: var ra = new List<RuleAction>(); ra.Add(new RuleAction()); var rc = new RuleCondition(); var rule = new Rule("test", rc, ra, null); Thanks ahead 回答1: I think this blog-post answers your question: Programmatically Create Windows Workflow Rules 来源: https://stackoverflow.com/questions/5350144/creating-rules