Skip to content
Advertisement

Tag: drools

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 Request Class Object: policyDataToBeVerified I converted the config.json into a JsonNode object:configJson and passed both policyDataToBeVerified and configJson to drools working memory. Below are the

How do I give Drools access to dynamically loaded classes?

I am trying to use a ClassLoader to load classes from .class files at runtime and use them in Drools rules (Drools 7.52.0). I am using this custom ClassLoader which reads from a file and uses ClassLoader.defineClass() to load a class. It’s similar to a URLClassLoader: I can use the ClassLoader to load a class, construct an instance, and access

Checking flag value before inserting flag in drools

I’ve produced a rule and it inserts a question in session. If the question is true, it inserts a FLAG and if the question is not true, it deletes the question and doesn’t update the flag. I need to check the value of the flag before inserting the question in the session. I have tried several ways to do this

Sum with Integer object if not null

I do not know if it is possible in Java but I need a method to do a special “add function”. Let me explain, SHORT VERSION: Is it possible to add an int with an Integer object? I need a method to check if that integer object exists, and add 0 if the object is null, add the correct value

Advertisement