Rules confilct and resulution strategy
by bobby nick
I am using Drools 5.5 and I have two drl files, i.e. Sample.drl, Sample1.drl, with four rules, two
sets of duplicate rules. When I assert facts, rules from Sample1.drl
file is getting fired. I assume in this situation rules are in conflict, therefore rules engine using rules resolution strategy firing rules
loaded last to knowledge base. But I don't find any documentation
indicating what leads to conflict in rules.
If anyone in mailing list has experienced
similar issue, appreciate if you could share.
Thanks,Amit
12 years, 1 month
Process' RulesetNode and SplitNode working memory
by kenhelmes
Hello,
I am working on proof-of-concept with the Process API. A small cutout of
code shows an example process:
startnode->actionnode->rulesetnode-splitnode(gateway). The process flow
starts and runs normally.
However, the splitnode constraint does not seem to use the working memory of
the rulesetnode and never finds a rule hit. Does the splitnode constraint
rule generated by drools, use the same working memory as the rulesetnodes?
If a rulesetnode has one ruleflow-group, is there a way to put the splitnode
constraint rule into the same ruleflow-group?
// Nodes
.startNode(1)
.name("Start")
.done()
.actionNode(2)
.name("Action")
.action("java", "System.out.println(\"Starting process\");")
.done()
.ruleSetNode(3)
.name("City is in list")
.ruleFlowGroup("CityRules")
.done()
// Gateway
.splitNode(11)
.name("Split 11")
.type(Split.TYPE_XOR)
.constraint(4, "yes", "rule", "mvel",
"City(name == \"Copenhagen\")")
.constraint(92, "no", "rule", "mvel",
"not City(name == \"Copenhagen\")")
.done()
--
View this message in context: http://drools.46999.n3.nabble.com/Process-RulesetNode-and-SplitNode-worki...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
calling a function in When of DRL
by wtang
I need to call a java function in the LHS (When part of the DRL) like so:
When
eval(DataComparator.compare("key1", "key2"))
where key1 and key2 are keys into a Map encapsulated by DataComparator
class. How do I pass the Map to the DataComparator class in the first
place. Do I have to do like so:
eval(DataComparator.init(Map<String, String> map)
eval(DataComparator.compare("key1", "key2")
This all seems like a bad hack to me.
What are the standard best practice to achieve what I need?
Also eval are slow why? is eval the only way to call a function in the When
part?
thx!
--
View this message in context: http://drools.46999.n3.nabble.com/calling-a-function-in-When-of-DRL-tp402...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
[Optaplanner] Filter values
by Mats Norén
Hi,
I've got a domain with the following entities:
- Person (planning entity)
- Desk (planning variable)
- DeskAssignment (solution)
All persons should be assigned to a desk according to some rules.
What I would like to do is to make certain Persons and their Desk
immovable, ie, they are assigned a desk in the initial solution and should
be fixed there. They are only there for the score calculation.
I looked at 14.3.1 Immovable planning entities but couldn't really see how
I would apply it to my use case.
Why is the filter applied at the planning entity level? Since it's the
planning variable that changes I thought that I should somehow filter the
allowed values for the Desk.
Regards,
Mats
12 years, 1 month
Facts - One to Many
by Ray Hooker
I am trying to figure out how to work with an existing model. The data is in
MongoDB with embedded documents. It is about patients would have
sub-documents. For example. An individual patient may have multiple
allergies. Also a patient has multiple medications. So it is as follows:
- Patient.medications ---> multiple Medication objects
So I see where you have a simple one to one. Typically perhaps you might
have the medication record know that it is associated with the patient, but
that is not how it is currently organized. So the question is can I write
rules when patients.medications returns a set/ collection of medications
associated with the patient. I want to write a rule such as "if a patient is
taking medication=xxx...."
Thanks for your help.
Ray Hooker
12 years, 1 month