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.
3,878
questions
0
votes
1
answer
19
views
Java Drools - How to fire two rules?
I'm new to drools and trying to fire two rules for my requirement.
Rules: Only one from the below, the first one W rule is firing, how to fire the second rule as well?
W rule:
rule "Send an ...
0
votes
1
answer
26
views
Jboss drools - Can I have multiple consequences in "then" condition and fire the rules?
I'm relatively very new to drools and have a requirement where I need to execute both consequences for my rule.
Creating new requests W and F.
Consequence in .dsl file
[consequence][]Create W Request ...
0
votes
1
answer
16
views
Classloader Leak while Deserializing KieBase
I'm using drools-core 7.68.0.Final to serialize a KieBase using DroolsObjectOutputStream. Each time that I subsequently deserialize the KieBase back into memory using DroolsObjectInputStream I get a ...
-1
votes
0
answers
22
views
Drools: load rules from application jar at runtime [closed]
I'm using Drools 7.72.0.Final embedded in a Quarkus application.
I keep my .drl files in src/main/resources so the application can easily access them when running locally in my ide.
When I build the ...
2
votes
1
answer
48
views
Is there a way to use Optional.orElse in eval?
I have a function that returns Optional that I want to use in drools eval, e.g.
rule "some rule"
when
eval(func().orElse(1.0) > 0.0)
then
....
end
where func() has return ...
0
votes
0
answers
15
views
Generating drools rules with description builder
Is there a way I can generate drools rules using CEDescriptionBuilder<> and
this
".or().pattern("something").constraint("somethingElse").end().pattern("something&...
1
vote
0
answers
39
views
Drools wont take complex data structure
I have a problem when I want to make a complex data structure in Drools.
I have this data structure : HashMap<Integer, HashMap<String, HashSet<Integer>>> and I want to use it in ...
0
votes
1
answer
30
views
Use KIE 7.73.0.Final with Camel 3.11.7 in Karaf 4.4.0
I want to migrate KIE 6.2.0.Final and DROOLS 6.2.0.Final which work fine with Apache Camel 2.25 in Apache Servicemix 7.1.0-SNAPSHOT (Karaf 4.0.7) to
KIE 7.73.0.Final, DROOLS 7.73.0.Final, Apache Camel ...
0
votes
0
answers
26
views
Use of a control fact
UPDATE
Introduced a control fact to control rules from firing. Facts are
Product (sku="zzz")
TextChoiceOption (sku="control", optionValueValue = "xxx")
DimensionOption (...
0
votes
0
answers
21
views
Activation Group and Salience - wrong rule being fired
I have the following 3 rules in my system. The facts match all 3 rules. Based on the salience and activation group I would expect either rule 10 or 11 to fire. However rule 12 is always firing.
To ...
0
votes
0
answers
42
views
ClassCastException: jbpm workflow is failing on last task/node after workflow diagram updated
After changing jbpm workflow diagram , old running process (which was completed till (endNode-1) node using old diagram) is failing at the last step while completing using jbpm new diagram.
Example :- ...
0
votes
0
answers
29
views
Drools using large RAM for larger rules
We have started using Drools [V 7.55.0.Final]. We have a requirement where we have large number of rules (~100,000) but have few(1-10) facts to process for every API request. A sample of each rule is ...
1
vote
0
answers
28
views
Custom drl operator not working in Drools 7.71 when upgrading from 7.31
We create what is essentially a custom operator called contains_any with a definition that implements org.drools.core.base.evaluators.EvaluatorDefinition. It was working in 7.31 at the latest that I ...
0
votes
1
answer
21
views
How do we assign an object to a newly created object in drool
I am new to drools and have a scenario where I have to assign an object1 to object2 and change one of the field value of object2 and pass it further so that I don't loose object1 and can use object1 ...
0
votes
1
answer
29
views
Limit access to classes from rule [drools]
I'm using drools with decision tables.
The decision table contains java code.
But for security reasons, I do not want that the designer of the excel be able to call any code from rule.
I want him to ...
0
votes
0
answers
34
views
Drool syntax: rule not fire with ',' syntax but works with ' ,' (with an additional space before comma)
I'm running into a weird issue that the drool rule does not give exceptions if the line ends in ',' but gives exception if there are additional space before comma (' ,'). Does anyone know why this is ...
2
votes
1
answer
82
views
Drools wants Java compiler, which is not present in custom image
All,
I have my optaplanner application using JavaFX. Running and testing it in IntelliJ's IDE was not the problem, but generating an application from it was really painful. Mainly due to the ...
0
votes
1
answer
33
views
How to set the default value if no conditions apply in drools decision table?
I am working with drools 7.69.0,
My purpose is to convert the below condition into a decision table at firstly,
Stream.of(usecase1, usecase2, usecase3, usecase4).collect(Collectors.toSet()).contains(...
1
vote
0
answers
28
views
Drools Unterminated Collection Element Error
I have when statement that goes from an if statement to the else statement:
rule "rule"
ruleflow-group "ruleFlow"
when
$block : Block()
$inst : BlockInstitution(...
0
votes
0
answers
17
views
Drools generate filters on rule dinamically
New with JBoss Drools :)
I'm working on a PoC where there's a rule where one or multiple filters can exist. I'm using a template to generate that rule dynamically.
template header
effectiveDate
...
0
votes
1
answer
13
views
Need to check if a value is within the range (upper limit and lower limit) configured in drools decision table
I am new to Drools. Now I need to validate one value is within the range configured in drools decision table.
Scenario: Salary is the condition and grade is the action (output).
I need to configure ...
0
votes
2
answers
36
views
Drools variable cannot be accessed in then clause
I have an Object Class with a couple of fields and methods that I can successfully access in the when clause:
public final class ObjectWrapper {
private Object object;
private Date approvalDate;...
0
votes
1
answer
78
views
Kogito Debugging DMN Test Scenarios
Using Kogito I'm trying to create a test scenario for a DMN file that returns an array. I created a simple DMN that would return an array of objects regardless of the input for the sake of testing.
...
0
votes
0
answers
23
views
Compare 2 fact input in Decision table with drools
I am trying to define an condition in my spread sheet rule. doctor and searchParam are Facts I inserted to Kiesession. One of my conditions, I want to compare 2 of them.
Are there any way to do it. ...
0
votes
0
answers
24
views
ReactiveProperties drives me crazy in Drools 7
Im using Drools 7.71.0.Final and Reactive properties are driving me nuts trying to understand how rules are evaluated in the following example.
I have confirmed that the following rule is executed as ...
0
votes
1
answer
35
views
Upgrade to Optaplanner 8/Drools: newKieSession returns null
I am trying to upgrade from Optaplanner 7 to Optaplanner 8.. I use drools in my project. Since I need the method fireAllRules I need access to the kieSession. Before upgrading this was easy with ...
0
votes
0
answers
25
views
newKieSession() for KieContainer and KieBase behave differently
I am trying to pass 70k messages through rule engine one by one. I want to bring down the processing time for this. The newKieSession() instantiation as per below implementation takes around 0.8 ...
-1
votes
1
answer
39
views
Iterate through List and pick right value using Drools
So I have a list of objects like this
public class BesPeople{
List<person>
}
public class person{
int height;
int weight;
int shoesize;
String votingRecord;
}
if I input a list into ...
0
votes
0
answers
16
views
Does DROOLS / JBPM Workbench support pre-commit hooks?
As the question states, does the Drools / JBPM Workbench support a pre-commit hook? I have a post-commit hook and it works just fine but my pre-commit is not getting fired.
post-commit looks like this ...
-1
votes
1
answer
28
views
Update rules on Drools
I am building a system where rules are updated very frequently.
By default the rules will be saved in a database. When
As far I understand, drools makes a sort of a tree when session is created.
Is ...
0
votes
0
answers
67
views
Drools not load rules from /resources
I have a project in Java + Drools.
It works great, but the thing is that the rules are located in a separate jar file. Worked even from the terminal. I moved all these rules to the main project in the ...
0
votes
0
answers
40
views
No files found for KieBase: XXXXRules
Getting the issue when I build the code as jar (spring boot app ) & run
WARN o.d.c.kie.builder.impl.KieProject - No files found for KieBase rrrrrules
It works fine when run in intellij ( without ...
0
votes
0
answers
75
views
Custom ClassLoader with Drools gives ClassCastException
I'm trying to use a custom ClassLoader with Drools to add some methods to my facts using javassist in runtime. Here's the custom ClassLoader that extends Loader of javassist:
@Override
public ...
1
vote
0
answers
39
views
Drools - Unable to cast object in rules THEN clause - used to work in older version
I'm running on Optaplanner 8.0.0.Final, the corresponding drools version I believe is 7.46.0.Final. This rule used to work fine on Optaplanner 7 (7.45.0.Final, drools version is also 7.45.0.Final).
my ...
0
votes
0
answers
35
views
Drools: How to use forall in decision table to match anyof or all the items in the comma seperated string
How to define Drool's conditional element forall in decision table? for ex. "fruit" and "vegetable" true if the input matches one of the comma separated string. "abc combo&...
1
vote
0
answers
24
views
Drool decision table evaluating boolean function
I have written a function in a Drools xlsx file, but it is behaving weirdly. My function check123() is returning a boolean value in the condition, but my action is called when function check123() ...
0
votes
0
answers
7
views
In Drool Xls Sheet I am making a function and calling a map object for get/put my data
just want explanation
I am trying to put data by my ec context object ,but drool xls is behaving so unpredictable because i written 2 same statements inside the function setPremium() but 1 is ...
0
votes
0
answers
33
views
Is it possible have OR condition in excel decision table
I am new to drools and I am exploring the decision table. I want to OR two columns in the decision table is it possible? Please go through the example it will help to understand my question and what I ...
1
vote
1
answer
112
views
Drools KieContainer does not fire rules with custom classloader
I am trying to add a non-existing method to a Java bean, compile it and use the newly added method in Drools rules. Via a custom class loader.
I am using CompilerUtils to bind newly modified class to ...
0
votes
0
answers
91
views
Drools WorkBench Settings.xml add remote Repository
I'm getting the following error in drools workbench:
17:40:29,027 ERROR [stderr] (default task-11) javax.net.ssl|DEBUG|E4|default task-11|2022-05-23 17:40:29.027 UTC|SSLSocketImpl.java:1361|close the ...
0
votes
0
answers
32
views
Getting problem while comparing string in Drools XLS decision table
In cell B11 I am trying to compare my data with below column by using $1, but it is not working, the issue occurs only for String data I think.
Can anyone give me right explanation/reason that why ...
0
votes
1
answer
22
views
Assign either of value that exists or not null RuleInput($date = (this["startDate"] || this["startingDate"]))
Inside RuleInput there may be either "startDate" or "startingDate" , I need to assign value to $date variable either of the value that exists.
Something Like,
RuleInput($date = (...
-1
votes
1
answer
39
views
Drools DRL Export to Java and Python
There is requirement to convert Drools DRL file into equivalent Java and Python Code as a Export Feature. Please provide some insights whether any tools available for this. Or we can use DRL Debug ...
0
votes
1
answer
54
views
Error creating bean with name 'kieServer' while running kie-server-spring-boot-sample
I am trying to start a springboot application residing here https://github.com/kiegroup/droolsjbpm-integration/tree/main/kie-spring-boot/kie-spring-boot-samples/kie-server-spring-boot-sample.
I cloned ...
1
vote
1
answer
82
views
How to compare nested JsonNode field values with Java object parameter values in DROOLS?
I've been trying to execute a set of rules on a request object on the basis of some set of configuration value. Below is the example on what I am trying to do:
Configuration:
config.json
{
"...
0
votes
1
answer
33
views
Drools cannot resolve a global variable
i'm trying to add String items to a global variable $items. But i get an error "$items cannot be resolved"
Below is snippet of my drl rule. What am i missing?
code snippet
0
votes
0
answers
21
views
How to Compute and get value of Formula defined inside rules in Drools?
I have drools UI created for my application, in the UI I have created some rules i.e(Fire rules if Quantity < 100), the rule i have created directly using literals(100) where drools directly ...
0
votes
1
answer
33
views
How to get the value in the enumeration declared in the drl file in java
I started learning drools recently, when I declared an enum type in drl file, but in java, I don't know how to get the value of this enum, can anyone help me?
First: enums declared in drools file
...
0
votes
0
answers
33
views
Want to compare Timestamps in Drools
I am to receive a timestamp value and want to check it agains the current timeStamp value to make sure that the value I am getting is less of before the current time stamp.
the value being sent is in ...
0
votes
0
answers
56
views
Drool resource url not able to read data from s3 bucket
I am trying to implement drool engine I have uploaded my xlsx file on my s3 bucket the issue comes when I try to get file from my s3 folder the code breaks and moves to catch block and the file is ...