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, 3 months
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, 3 months
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, 3 months