Drools 5.5 run time exception from the library code but no impact to the rule evaluation result
by Sean Su
Just want to put the exception out here in case it is meaningful to the
development or whoever ran into this before. It occurred but does not
impact the result of the process.
Exception in thread "Thread-6" java.lang.NullPointerException
at java.lang.String.<init>(String.java:210)
at org.mvel2.ast.ASTNode.toString(ASTNode.java:426)
at org.mvel2.ast.Or.toString(Or.java:59)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeNode(ConditionAnalyzer.java:247)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:106)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:99)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:70)
at
org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:83)
at
org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:270)
at
org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:51)
at
org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:250)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Sean
11 years, 7 months
Consequence Exception with too many events
by Jason Barto
I am new to Drools (Expert and Fusion) and have been reading through the
materials over the last few days. After going through some of the tutorial
code I wrote a very quick and dirty to perform a base assessment of the
speed of Fusion / Expert. My code is below. The strange thing I'm
currently receiving is, if I insert 100k events the test completes
successfully, if I insert 150k events, I receive a ConsequenceException
caused by an NPE. Being new to Drools I must be doing something wrong, can
anyone please provide some guidance?
(Main function)
Counter cc = new Counter ();
session.insert (cc);
for (int i = 0; i < 150000; i++) {
entryPoint01.insert (new MyEvent ());
}
(Counter Class)
public class Counter {
private long total = 0;
// get / set total
public void addValue (int val) {
total += val;
}
}
(MyEvent Class)
public class MyEvent {
private int value = 1;
// get / set value
}
(DRL file)
declare MyEvent
@role (event)
@expires (1s)
end
rule "Count the rules"
when
$ev : MyEvent () from entry-point entryPoint01
$pc : Counter ()
then
$cc.addValue ($ev.getValue ());
end
11 years, 7 months
Camel get ksession results
by mauro
Hi,
I'm using Drools integration with Camel and have to be able to get the
objects that were validated by a rule in a stateless ksession later in the
Camel route.
My camel-server.xml has something similar to this:
<policy ref="droolsPolicy">
<bean ref="createList" />
<to uri="drools:node1/ksession1" />
<bean ref="afterRules" />
</policy>
in the "createList" bean I create a list of java objects and call
CommandFactory.newBatchExecution(commandList);
My Drools rule responds as expected. So far so good.
But then later when execution reaches "afterRules" bean, the exchange body
has empty lists for both "facts" and "results".
What I want at this point is to be able to get all the objects which were
compatible with the rule (a simple sysout). The ones that didn't match the
rule, are simply disposed.
How can I solve that?
Drools v5.5.0 Final
Camel 2.10.4
Thanks!
Mauro
--
View this message in context: http://drools.46999.n3.nabble.com/Camel-get-ksession-results-tp4023670.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
GSOC project - Realtime Collaborative Editor for Drools Decision Tables using Errai OT/EC
by Mark Proctor
Errai has recently added OTEC support, which is a web based system for collaborative editing. I thought this would be really interesting project, working on cutting edge web technologies for anyone doing a GSOC submission. Or actually anyone looking for an engaging task :)
https://community.jboss.org/wiki/GSOC13Ideas#Realtime_Collaborative_Edito...
Errai OTEC (Operationaly Transformed, Eventually Consistent Data Syncrhonization) facilitates builing Google Wave and Google Docs type applications, with multiple authors in real time on the same document. Two videos showing OTEC editing working in real time for collaboritive authoring:
https://www.youtube.com/watch?v=ChCasRr0cZc
https://www.youtube.com/watch?v=Wvf5pbOM920
Drools has extensive Decision Table support, which provides a spreadsheet like authoring tool for rules. Errai OTEC can allow two authors to work on the document at the same time. It would provide the following features:
-Current cursor/edit location for each user in the document.
-Edits to Cells to appear as they happen.
-Cell locking, so only one Cell can be updated by one user at a time.
Knowledge prerequisite:
Java, GWT, Errai
Skill level: Medium
Contact(s): Michael Anstis
Mentor(s): Michael Anstis
Associated project(s): Drools, Guvnor, Errai
Notes:
11 years, 7 months
"drools" key word
by rjr201
I was looking for a way to get a rule's name within the 'then' condition of
the rule.. found an old post on another forum that recommended this (which
works):
drools.getRule().getName()
My question is, what is this 'drools' keyword? could anyone point me to
documentation that outlines what else can be done with it.
Thanks in advance.
Rich.
--
View this message in context: http://drools.46999.n3.nabble.com/drools-key-word-tp4023662.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Re: [rules-users] Some Puzzles in planner
by ge0ffrey
erere121 wrote
> Hello every one ,I study the drool.plannar recently and both tried the
> planner 5.5 and planner 6.0(optaplanner) to solve my problem. I found
> something puzzles:
>
> 1 Is there any big difference between planner 5.5 and planner 6.0. I run
> the same process in both planner 5.5 and planner 6.0 with the same config,
> I find planner 5.5 gives the solution with 19hard broken while planner 6.0
> give the solution with 502hard broken !!!!! I am not sure why it happens.
>
> 2 When I open the demo in optaplanner in eclipse, I find every
> "scoreHolder.addConstraintMatch(....);" have the error like this:The
> method addConstraintMatch(kcontext,..) in the type SimpleScoreHolder is
> not applicable for the arguments (RuleContext, int)", can anybody help me.
>
> 3 The problem has a solution which breaks no rules while both planner 5.5
> and 6.0 never found it using the tabu search and hill climb search. I
> wonder is it right or is there any other global search method in planner.
1. That should not happen. Turn on enviromentMode FAST_ASSERT to validate
you don't have any score corruption.
2. Sounds like your eclipse is using the wrong optaplanner-core jar on it's
classpath to compile
3. It could be that there's no feasible solution (= 0 hard constraints
broken) to your solution, but I 'd only start believing this if
environmentMode doesn't find any score corruption. If it's a really tiny
problem, you can use the configuration <bruteForce> to be 100% sure. (Note:
Tabu search currently doesn't automatically scale down to tiny problems (=
less than 10 planning entities), you have to manually lower the
planingEntityTabu configuration setting.
--
View this message in context: http://drools.46999.n3.nabble.com/Some-Puzzles-in-planner-tp4023580p40236...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
[Planner]
by Mats Norén
Hi,
I've got a really simple problem that I can't seem to fix. :-)
I'm trying to use a simplified model for a room planning problem.
The planning entity is a Topic and the planning variables are Room and
TimeSlot.
A Person is tied to a Topic as a moderator.
Each Person can have multiple Topics as an interest.
The hard constraints are that a Person cannot be moderator in two Topics at
the same TimeSlot and that there cannot be multiple Topics in the same Room
at the same TimeSlot.
rule "conflictingModeratorInSameTimeslot"
when
$leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot
!= null, $leftModerator: moderator)
$rightTopic : Topic(timeSlot == $leftTimeslot, moderator ==
$leftModerator, id > $leftId)
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
rule "multipleTopicsInSameRoomAndTimeslot"
when
$leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot
!= null, $leftRoom: room)
$rightTopic : Topic(timeSlot == $leftTimeslot, room == $leftRoom,
id > $leftId)
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
The soft constraint that I have a problem with is that a Person has
multiple Topics as interests and I would like to penalize the Solution with
the number of Topics in the Persons interests collection with the number of
Topics that are allocated at the same TimeSlot.
Any ideas on how to go about this?
Regards,
Mats
11 years, 7 months
Re: [rules-users] KnowledgeAgent to update knowledge base built with Guvnor pkg
by Roger Swanson
I also had an issue at one point where the agent detected new knowledge but it didn't seem to load within the current knowledge base. I was able to fix it via the agent config:
KnowledgeAgentConfiguration agentConfig = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
agentConfig.setProperty("drools.agent.newInstance", "false");
KnowledgeAgent agent = KnowledgeAgentFactory.newKnowledgeAgent("myagent", agentConfig);
-----Original Message-----
From: riri [mailto:irina.adam@gmail.com]
Sent: Wednesday, May 01, 2013 6:25 AM
To: rules-users(a)lists.jboss.org
Subject: Re: [rules-users] KnowledgeAgent to update knowledge base built with Guvnor pkg
Nobody has any ideas on how to solve this? I am willing to try anything that might work short of re-creating the knowledge base everytime I start a new session.
And when using the changeSet() method for the knowledge agent, how would one set the knowledge base properties? Like functioning in STREAM mode and not CLOUD.
Please, anyone, I really need your help.
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-to-update-knowledge-base...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Is there a way to add a JAR to a knowledBuilder
by Charles Moulliard
Hi,
Is there a way to add a JAR to a knowledgeBuilder with a method like that ?
kbuilder.add(ResourceFactory.newUrlResource("file:///model-1.0-SNAPSHOT.jar"),ResourceType.JAR);
Regard,
--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
11 years, 7 months