drools

is it possible to extend a rule using a specified set of parameters or pass parameters into a rule in Drools?

霸气de小男生 提交于 2019-12-12 01:24:53
问题 I have a large number of almost duplicate rules to implement. They are the exact same but the right hand sides are slightly different. eg rule "AS77" extends "IVD01" @description(" IF Individual Identifier = E, THEN Other Description is required. ") when $source : Owner($errCode : "427") then end rule "AS78" extends "IVD01" @description(" IF Individual Identifier = E, THEN Other Description is required. ") when $source : JntOwner($errCode : "428") then end rule "IDV01" @description("IF

Ignore an attribute value dynamically in drools rules

廉价感情. 提交于 2019-12-11 23:58:33
问题 I have a situation Where I need to ignore any attribute value at run time. $applicant : Applicant ($age : age, $gender : gender, $income : income) $person : Person( age == $age, gender == $gender, income == $income ) Say in income attribute, I am saying ANY value; it means if der is any value specified in application income attribute then it is ok otherwise also it should execute the rule because ANY value is acceptable. Please help to implement this. Thanks 回答1: For a dynamic switch you need

drools rule get value from a map

自闭症网瘾萝莉.ら 提交于 2019-12-11 22:44:26
问题 How to get the perticular value in the drools when block. I am looking for something like this but its not working: I have inserted Hashmap into Working memory and trying to retrieve it in When $expiry_date:HashMap(get("CREDIT_CARD_EXPIRATION_DATE")); eval(ageInDays($expiry_date)>10) ; I get below error [42,37]: [ERR 101] Line 42:37 no viable alternative at input '"CREDIT_CARD_EXPIRATION_DATE"' in rule "Rule1" in pattern HashMap 回答1: For maps/lists/arrays, you can use [] syntax to access

Drools: cannot start container on remote kie-server, for “Could not find artifact …”

北慕城南 提交于 2019-12-11 20:40:21
问题 On a server with drools workbench and KIE server both installed, I authored a project, and got it built and deployed. Also, I can start a container for it locally . But I could not create a container for it on a remote server , and got the following error on remote server: Unable to resolve artifact: testdrools:firstApplication:pom:1.3 org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact testdrools:firstApplication:pom:1.3 in central (http://repo1.maven.org

Drools Rules Fireing Order when Fact data changes

心已入冬 提交于 2019-12-11 19:39:19
问题 I am new to Drools and either I misunderstand what Drools can do or I am missing something. I have a simple Fact class public class MeterReadTO { private String status = ""; public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public boolean isInvalid() { return status.equals("invalid"); }; } With the rules rule "Rule Invalid" dialect "mvel" when MeterReadTO( isInvalid()); then System.out.println("Rule Invalid Fired"); end rule "Rule Not

Drool with Wildfly is not responding under Load

℡╲_俬逩灬. 提交于 2019-12-11 19:07:41
问题 I have set up Drool rule Engine 7.15 with Wildfly 15.0(jboss) server version. Normally it works fine. But when the Load is more to the rule Engine i.e more request concurrently come. It stops responding until the rule is deployed again. This could be the issue with the container of wildfly. Can any one help inthis regard. -ram 回答1: Dear Anton Giertli, I am using 'wildfly-17.0.0.Final' server and deployed 'kie-server-7.17.0.0.war' along with this my application code as 'kie-builder.war' also

Drool 5.3.3.Final to Drool 6.0.0.Final Migration. RuleAgent alternate in Drool 6

不问归期 提交于 2019-12-11 17:37:19
问题 I am new to drool and question might be quite easy but headache for a now what is the alternate to org.drools.agent.RuleAgent in drools 6.0.0 or how can i create newInstance of RuleAgent using drool 6.0.0. 回答1: The DroolsAgent class was removed from version 6 and greater. You can achieve a similar behavior (and probably event more) with the KieScanner or with KieContainer.updateToVersion() . Both ways are kind of documented in the oficial documentation. KieScanner: http://docs.jboss.org

Optaplanner List Planning variable

妖精的绣舞 提交于 2019-12-11 17:31:42
问题 Downloaded OptaPlanner examples, testing them. In the Meeting Scheduling example provided, a single planning variable is returned in the solved solution. for example, for a meeting scheduling, one Room is returned. I am planning to allocate multiple rooms for a single meeting schedule if the locations are different (assuming VC enabled for remote rooms). Current Meeting Scheduling example does not show this. Do I need to change the planning variable room to a List? 回答1: Planning variables can

开源规则流引擎实践

╄→尐↘猪︶ㄣ 提交于 2019-12-11 16:58:51
阅读更多 前言 在很多企业的 IT 业务系统中,经常会有大量的业务规则配置,而且随着企业管理者的决策变化,这些业务规则也会随之发生更改。为了适应这样的需求,我们的 IT 业务系统应该能快速且低成本的更新。适应这样的需求,一般的作法是将业务规则的配置单独拿出来,使之与业务系统保持低耦合。目前,实现这样的功能的程序,已经被开发成为规则引擎。 规则引擎是一种推理引擎,它是根据已有的事实,从规则知识库中匹配规则,并处理存在冲突的规则,执行最后筛选通过的规则。因此,规则引擎是人工智能(AI)研究领域的一部分,具有一定的选择判断性、人工智能性和富含知识性。目前,比较流行的规则引擎有商业规则引擎 iLog 和开源规则引擎 drools。本文将对开源规则引擎 drools 做详细介绍,并通过分析一个在汽车保险行业中的实际应用案例,让读者对开源规则流引擎有一个更深刻的理解。 1. 基于 rete 算法的规则引擎 在 AI 领域,产生式系统是一个很重要的理论,产生式推理分为正向推理和逆向推理产生式,其规则的一般形式是:IF 条件 THEN 操作。rete 算法是实现产生式系统中正向推理的高效模式匹配算法,通过形成一个 rete 网络进行模式匹配,利用基于规则的系统的时间冗余性和结构相似性特征 [8],提高系统模式匹配效率。本文将介绍的 Drools 引擎就是利用 rete 算法对规则进行分析,形成

Drools 7, event listener to whenever a rule is activated (even if partially matched)

大憨熊 提交于 2019-12-11 16:18:34
问题 I'm using Drools 7.8 and DefaultAgendaEventListener to handle events. I'm trying to handle the event when a rule is activated (even if it was partially matched) but have failed so far with every one of the events handled by that class. For example let´s say i have this rule: rule "A" when ConditionA ConditionB ConditionC then Consequence end I want to handle the event when any of those 3 conditions (A,B or C) is met, even if the consequence is not fired but it's been hard to find the correct