drools

Using Drools 6 Maven architecture completely offline

懵懂的女人 提交于 2019-12-04 06:22:04
问题 I am using Drools 6.0.1 and making use of the new Maven-based architecture to deploy my rules. The POM of the project looks like shown at the end of this post. I start the project with the parameter -Dkie.maven.settings.custom="X:\\maven2\\settings.xml" to use a separate Maven repository for Drools. That settings.xml is also shown below. When I run the project (.java shown at the end), the drools-internal maven, namely Aether , still adds the central repository to its internal configuration.

Drools disable a rule at runtime

江枫思渺然 提交于 2019-12-04 03:21:52
I'm starting a project whith Drools and Drools Guvnor. My rules are deployed in drools guvnor. My rule engine instance can access those rules via the pkg file exposed by drools Guvnor when you do a package release build and release. This is all working fine, what I'm looking for is a solution for disabling a rule at runtime. The only solution I have right now is to go to guvnor, archive the rule and do a build + release of the package containing that rule. Isn't there another strategy ? There are a few ways of solving this, depending on your requirements and architecture. One way is to define

understanding working of Drools guvnor

为君一笑 提交于 2019-12-04 02:29:50
问题 can any one plz let me know that how drool guvnor work i went to guvnor documentation but couldn't understand the core logic of how rules are processed and how we can use drools guvnor in coherence with java code Basically i want to know how java code interacts with drools guvnor api. 回答1: There is very less documentation about latest drool 6. I suggest you watch this presentation by Mark Proctor on drools 6 (Drools Project Lead at Red Hat) and visit his Youtube Channel to watch screencasts

Why does the order of how we specify the variables in a '==' comparison matter?

三世轮回 提交于 2019-12-03 22:09:56
问题 What i noticed is that there is a big performance difference by just changing the order of the variables that are compared with the '==' operator. For example $variable == variable is considerably slower than variable == $variable. Why is this so and are there similar cases like this one? By the way i am using a version of OptaPlanner from GitHub downloaded from GitHub that uses the "7.0.0-SNAPSHOT" Drools version. This is the case in all the rules that do a cross product where i try to match

Drools 6.4 KieScanner : How create and add Jar with rules in Maven?

谁都会走 提交于 2019-12-03 20:55:19
I am a beginner with Drools and Maven and I am facing a problem to load rules with KieScanner. The aim of the project is to be able to dynamically load rules in a permanent KieSession. I wonder if it is possible to manage rules with the KieFileSystem (not sure it is possible without a dispose of the session and starting another one leading to the lack of the previous inserted facts), but the good way is to use KieScanner. It seems this requires the creation of a Jar containing the rules and having a Maven ID (ReleaseId), but I could not find detailed documentation about creation of these Jar

Can't run hello world on drools - dlr files are not picked from classpath by KieContainer

拟墨画扇 提交于 2019-12-03 20:44:13
Following documentation: 6.1. The Basics I created a simple class Applicant which should be checked with drl file loaded from the class path by KieContainer. From the doc: " At this point it is possible to create a KieContainer that reads the files to be built, from the classpath. KieServices kieServices = KieServices.Factory.get(); KieContainer kContainer = kieServices.getKieClasspathContainer(); The above code snippet compiles all the DRL files found on the classpath and put the result of this compilation, a KieModule, in the KieContainer. If there are no errors, we are now ready to create

Matching a list (of tags) with another and detecting presence of common elements

给你一囗甜甜゛ 提交于 2019-12-03 18:14:14
问题 My requirement is to match tags. In the example, this particular HourConstraint checks the TeacherHour assigned to Hour(23) . Specifically, it checks TeacherHour.attributes["tags"] for the values ["asst_ct","teacher_john_smith"] and detects atleast one match , two in this case (both "asst_ct" and "teacher_john_smith" ) . TeacherHour: id: 47 assigned_hour: Null attributes:Map<List<String>> "tags":["asst_ct","no_strenuous_duties","kinda_boring","teacher_john_smith"] "another_attribute":[...]

Should I use Drools in this situation?

Deadly 提交于 2019-12-03 17:44:24
问题 I'll use a university's library system to explain my use case. Students register in the library system and provide their profile: gender, age, department, previously completed courses, currently registered courses, books already borrowed, etc. Each book in the library system will define some borrowing rules based on students' profile, for example, a textbook for the computer algorithm can only be borrowed by students currently registered with that class; another textbook may only be borrowed

Decision trees and rule engines (Drools)

大憨熊 提交于 2019-12-03 17:39:27
问题 In the application that I'm working on right now, I need to periodically check eligibility of tens of thousands of objects for some kind of a service. The decision diagram itself is in the following form, just way larger: In each of the end nodes (circles), I need to run an action (change an object's field, log information etc). I tried using Drool Expert framework, but in that case I'd need to write a long rule for every path in the diagram leading to an end node. Drools Flow doesn't seem to

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

妖精的绣舞 提交于 2019-12-03 17:26:32
问题 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 and an API for working with it: https://docs.jboss.org/drools/release/5.6.0.Final/drools-expert-docs/html/ch04.html#d0e8052. The drools documentation as of 5.6 indicates this deprecated and it appears to be completely removed at 6. I don't want to