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.

www.jboss.org/drools

The Business Logic integration Platform provides a unified and integrated platform for Rules, Workflow and Event Processing. It's been designed from the ground up so that each aspect is a first-class citizen, with no compromises.

3669 questions
16
votes
2 answers

understanding agenda-group in drools

I tried a sample example to see how agenda-group works. Initially I set the focus of ksession to agenda-group "ag1" and fired the rules. package com.sample import com.sample.DroolsTest.Message; rule "Hello World" agenda-group "ag1" when …
Manish Mulani
  • 6,267
  • 9
  • 38
  • 45
16
votes
1 answer

Exception Catching in the LHS of Drools

I have a problem where the when clause of a drools rule throws a MethodNotFoundException. I'm looking for a way to figure out which rule it is during runtime to be able to remove it from the list of rules to use. Rule Example Rule "FooBar" when …
Mason T.
  • 1,517
  • 1
  • 14
  • 31
16
votes
3 answers

Using a workflow engine, state machine engine or rolling my own?

I'm confused. I'm developing a grails based internal tool for my company. One component in this tool is a simple issue tracker (a Helpdesk feature). I have domain objects such as Problem, Question and NewFeature. Each of these domain classes have…
Henrik
  • 3,737
  • 1
  • 17
  • 18
15
votes
2 answers

Drools Rule depending on Knowledge from JDK Map (not within non-JDK Class)

I'm trying to write the below Rule, which depends on Knowledge provided in the below main that uses just a JDK [library] Map (instead of a Map within a non-library Class). But it doesn't seem to be working... Main method: Map mapa =…
user1182373
  • 153
  • 1
  • 1
  • 5
15
votes
5 answers

Drools: storing rules in database

Currently I store all rules files on the file system (there are lots of versions of them) and load the different versions of them into memory at startup. I would like to change to storing my drools files in a database and was wondering if there is…
ghosttrain
  • 151
  • 1
  • 1
  • 4
15
votes
2 answers

How and is it worth to integrate Java Webapp + drools + Guvnor?

I am planning on introducing Java rules and currently in the process of evaluating Drools to externalize (physically and logically) the business rules from the application. Since these business rules would be very often by the business, I would want…
Sudhakar
  • 4,663
  • 1
  • 29
  • 42
14
votes
1 answer

Drools KnowledgeBase Deprecated

I am integrating the Drools Rules engine into my application. 99% of the examples I have found to get started look like: KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add( ResourceFactory.newUrlResource( url ), …
Jacob Schoen
  • 13,416
  • 15
  • 79
  • 100
14
votes
2 answers

Get Rule name in "then" clause in drools

Is it possible to retrieve rule name in the then clause of drool rule? rule "A" when --- then // something that outputs "A" Thanks.
Manish Mulani
  • 6,267
  • 9
  • 38
  • 45
13
votes
4 answers

drools rule flow

I'm having a strange issue with drools : I have the following rules : rule "is my dog a baby?" ruleflow-group "dog" salience 10 when dog : Dog(age <1 ) then dog.setIsBaby(true); end rule "baby dog" ruleflow-group "dog" …
Ricky Bobby
  • 7,282
  • 7
  • 40
  • 59
13
votes
3 answers

What is the new accepted way of programmatically creating new drools rules in Drools 6?

In short I want to create, edit and delete rules from a rules repository at runtime. I'm having trouble figuring out how to do this in drools 6+. I know in a previous version of drools (<= 5.6), that there was an XML representation of a .drl file…
Peter Smith
  • 819
  • 1
  • 11
  • 27
13
votes
2 answers

Expert/Rule Engine that updates facts atomically?

Atomically might not be the right word. When modelling cellular automata or neural networks, usually you have two copies of the system state. One is the current state, and one is the state of the next step that you are updating. This ensures…
AaronLS
  • 34,709
  • 17
  • 135
  • 191
13
votes
3 answers

Data Driven Rules Engine - Drools

I have been evaluating Drools as a Rules Engine for use in our Business Web Application. My use case is a Order Management Application. And the rules are of following kind: - If User Type is "SPECIAL" give an extra 5% discount. - If User has made…
Jasper
  • 7,524
  • 24
  • 87
  • 131
13
votes
1 answer

what is the difference between no-loop and lock-on-active in drools

Here is an example of a rule that uses "no-loop": rule "Even Number Rule" dialect "java" no-loop when n : Number( number !=0 && (number%2)==0 , value : number) then modify(n){setNumber(8)}; end
Anil Kumar
  • 1,041
  • 2
  • 9
  • 13
12
votes
1 answer

Google collect import in Drools

When I try to import MultiMap in Drools rule it caused an error below [11,25]: [ERR 102] Line 11:25 mismatched input 'COLLECT' expecting 'identifier' in import Does anyone know how can I import any com.google.common.collect in Drools rule? P.S.…
Alexander Zhugastrov
  • 11,184
  • 2
  • 17
  • 21
12
votes
8 answers

Drools 7.4.1 kieservices.factory.get() returns null

I try to integrate Drools 7.4.1 into a webapp in tomcat. When I call in the code the following statement to get a KieService I get null. KieServices ks = KieServices.Factory.get(); When the same method is being called from a test method it is ok.…