Questions tagged [drools]

Drools is a business-rule management system (BRMS) with a forward-chaining-inference-based rules engine, more correctly known as a production rule system, using an enhanced implementation of the Rete algorithm.

https://www.drools.org/

Drools is a Business Rules Management System (BRMS) solution. It provides a core Business Rules Engine (BRE), a web authoring and rules management application (Drools Workbench), full runtime support for Decision Model and Notation (DMN) models at Conformance level 3 and an Eclipse IDE plugin for core development.

4035 questions
1
vote
1 answer

Multi-accumulate in Drools

I have a scenario where i need to accumulate two different sets from the same input: accumulate (ord : Order(type == A); $aSet : collectSet(ord)) accumulate (ord : Order(type == B); $bSet : collectSet(ord)) Is there a way to accomplish it with only…
supermax2015
  • 69
  • 10
1
vote
1 answer

Drools compare two objects in decision table

I have the following code in DRL file rule "MyExample" when $eentity : ExampleEntity() $sentity : SecondEntity( secondField == $eentity.getMainField()) then System.out.println(true); end This is works but I need to convert it to…
Squeez
  • 919
  • 2
  • 12
  • 30
1
vote
1 answer

In Drools, can a selection clause (using keyword `from`) be written over an Iterable or Iterator?

Given a Java interface like this: class Hobby { public String getName() {...} } class Person { public Iterable getHobbies() {...} } How can I, in a LHS expression, select Hobby objects with a specific name. For example, something…
E-Riz
  • 31,431
  • 9
  • 97
  • 134
1
vote
1 answer

Storing large reference data objects in Drools

I'm looking for a way to store large objects within Drools for long periods of time (i.e. not like facts which are added and removed from within a session). I've read that Drools works using KnowledgeBases and Sessions (Stateless & Stateful) and…
GroomedGorilla
  • 920
  • 2
  • 10
  • 30
1
vote
1 answer

Facing "unqualified type in strict mode for: MessageExchangePattern" while trying to integrate Mule with Drools

i am trying to integrate mule with drools, i have mainly followed the tutorial here but i am getting this error : (1,22) unqualified type in strict mode for: MessageExchangePattern (1,30) unqualified type in strict mode for: ONE_WAY ' it seems…
MoienGK
  • 4,544
  • 11
  • 58
  • 92
1
vote
2 answers

What does "The prefix "vm" for element "vm:endpoint" is not bound." means and how to solve it?

I am trying to integrate mule with drools, I have mainly followed the tutorial here but I am getting this error : "The prefix "vm" for element "vm:endpoint" is not bound." can anyone help me solve this problem? following is my .drl file and mule…
MoienGK
  • 4,544
  • 11
  • 58
  • 92
1
vote
2 answers

drools.getRule().getName() in attributes -rule drool file

I need to enable / disable certain rules from drl file based on data from the backend . i.e enable Rule 1,2,3 for Dubai , Enable 1,3 for Singapore So , I pass drools.getRule().getName() as below. rule "Apply 50% discount to VIP customers" …
Hardik Amlani
  • 11
  • 1
  • 2
1
vote
0 answers

Drools workbench test scenarios

Two part question: I need to setup test case where one bean/fact has collection of items - is it possible to do with workbench editor, I picked Guided list and for each item I was trying to do new Item('sku', 'name') .. but when it tries to…
vladsfl
  • 617
  • 8
  • 18
1
vote
1 answer

How to join two query in drools rule language

I have two queries used to find specific items, they are as follows: query "score" (double s) Item( score > s ) end query "price" (double p) Item( price < p ) end The following query is used to find items score > s or price < p: query…
moshangcheng
  • 259
  • 3
  • 14
1
vote
1 answer

Drools: using the same DSL definition twice with a variable throws a duplicate variable error

If you define a DSL file with some lines, and one of them uses a variable, you cannot use it twice in a rule because you will get a duplicate variable error. What's the best way to avoid this? Ideally I would like to avoid to create two copies of…
Francesco
  • 857
  • 1
  • 11
  • 26
1
vote
1 answer

How to avoid loops in Drools without using NO-LOOP attribute?

Is there any possible way to avoid looping without using NO-LOOP attribute of Drools(Like I have heard we can achieve this by using the not(!) operator on objects but am unable to find out.) The problem is NO-LOOP attribute can't be used(as that is…
Hitesh Garg
  • 1,211
  • 1
  • 10
  • 21
1
vote
0 answers

Drools, KIEBASE serialisation

I'm working with drools 6.0.1.Final using maven to create an android app. To reduce the workload of the mobile i've decided to compile the rules on my destop/server and then package the compiled rules in the mobile app. My problem is that i'm unable…
1
vote
2 answers

Drools marshall/unmarshall not save global

I have a Test to unmarshall kiesession, with data in Global, but the unmarshall not return global. The code is that : Java Test KieServices kieServices = KieServices.Factory.get(); KieContainer kContainer =…
iflores
  • 43
  • 7
1
vote
1 answer

Optaplanner newbie: nurse softconstraint for weekends

I'm studying Optaplanner, and am doing some experiments with the Nursing Roster. My goal, for this experiment, is simple: to have nurse "1" be more in favor, and more likely, to work weekends. I have written the following rules to help make this…
Magick
  • 4,603
  • 22
  • 66
  • 103
1
vote
1 answer

Drools exception in new version of Grails

First of all I am referring to this question (LINK) which did not help me because then versions of frameworks were lower so I am starting new question. So I am using Grails 2.4.3 framework and trying to use Drools rule engine inside it. Java version…
Ivan Longin
  • 3,207
  • 4
  • 33
  • 42