Why are indented keywords in template causing NPE or DecisionTableParseException?
by magnusv
Drools 5.5.0
Indenting the "template header" or "rule" keywords in a template file will
cause exceptions on expansion. I believe it might be related to this old
JIRA issue: https://issues.jboss.org/browse/JBRULES-2786
"DecisionTableParseException" and "NullPointerException" are thrown. See
example code and related stack traces below.
Is this a bug in drools or is the template formatting intended to be this
strict? Or am I doing something else wrong?
=====================
Indented template header:
" template header
age
type
log"
Gives the exception:
org.drools.template.parser.DecisionTableParseException: Missing header
at
org.drools.template.parser.DefaultTemplateContainer.parseTemplate(DefaultTemplateContainer.java:87)
at
org.drools.template.parser.DefaultTemplateContainer.<init>(DefaultTemplateContainer.java:47)
at
org.drools.decisiontable.ExternalSpreadsheetCompiler.compile(ExternalSpreadsheetCompiler.java:97)
=====================
Indented rule keyword:
" rule "Cheese fans_(a){row.rowNumber}"
when
Person(age == @{age})"
Gives the exception:
java.lang.NullPointerException
at
org.drools.template.parser.DefaultTemplateColumn.createCellCondition(DefaultTemplateColumn.java:67)
at
org.drools.template.parser.DefaultTemplateColumn.addCondition(DefaultTemplateColumn.java:90)
at
org.drools.template.parser.DefaultTemplateRuleBase.createColumnConditions(DefaultTemplateRuleBase.java:103)
at
org.drools.template.parser.DefaultTemplateRuleBase.createTemplateRule(DefaultTemplateRuleBase.java:96)
at
org.drools.template.parser.DefaultTemplateRuleBase.getDTRules(DefaultTemplateRuleBase.java:83)
at
org.drools.template.parser.DefaultTemplateRuleBase.<init>(DefaultTemplateRuleBase.java:62)
at
org.drools.template.parser.TemplateDataListener.<init>(TemplateDataListener.java:74)
at
org.drools.decisiontable.ExternalSpreadsheetCompiler.compile(ExternalSpreadsheetCompiler.java:99)
--
View this message in context: http://drools.46999.n3.nabble.com/Why-are-indented-keywords-in-template-c...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
[planner] Looking for testimonials for Drools Planner
by Geoffrey De Smet
Hi Planner users,
I need your help :)
Lately, several people have been asking me for public testimonials for
Drools Planner.
So if you're a Planner user, would like to say a few words about it by
responding to this mail?
Say what you want.
It's extra nice if you can mention the benefits, project status
(development/production), country and/or company,
but that's optional (as it might be too sensitive to mention that).
Thanks in advance,
Geoffrey De Smet
12 years
Drools 5.4 Jitting Error
by gboro54
I just updated to Drools 5.4 and I am not getting the following error on all
my map accessors:
10:41:12,997 ERROR [stderr] (Thread-169) Exception in thread "Thread-169"
java.lang.RuntimeException: Exception jitting: feeKeys[1] == null
10:41:12,998 ERROR [stderr] (Thread-169) at
org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:219)
10:41:12,999 ERROR [stderr] (Thread-169) at
org.drools.rule.constraint.MvelConstraint.access$000(MvelConstraint.java:41)
10:41:13,000 ERROR [stderr] (Thread-169) at
org.drools.rule.constraint.MvelConstraint$1.run(MvelConstraint.java:201)
10:41:13,000 ERROR [stderr] (Thread-169) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
10:41:13,001 ERROR [stderr] (Thread-169) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
10:41:13,002 ERROR [stderr] (Thread-169) at
java.lang.Thread.run(Thread.java:662)
10:41:13,002 ERROR [stderr] (Thread-169) Caused by: java.lang.VerifyError:
(class: ConditionEvaluator51817e9f4a7542c5b295be7d674f854c, method: evaluate
signature:
(Ljava/lang/Object;Lorg/drools/common/InternalWorkingMemory;Lorg/drools/reteoo/LeftTuple;)Z)
Expecting to find object/array on stack
10:41:13,004 ERROR [stderr] (Thread-169) at
java.lang.Class.getDeclaredConstructors0(Native Method)
10:41:13,004 ERROR [stderr] (Thread-169) at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
10:41:13,005 ERROR [stderr] (Thread-169) at
java.lang.Class.getConstructor0(Class.java:2699)
10:41:13,005 ERROR [stderr] (Thread-169) at
java.lang.Class.getConstructor(Class.java:1657)
10:41:13,006 ERROR [stderr] (Thread-169) at
org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:173)
10:41:13,006 ERROR [stderr] (Thread-169) at
org.drools.rule.constraint.ASMConditionEvaluatorJitter.jitEvaluator(ASMConditionEvaluatorJitter.java:53)
10:41:13,007 ERROR [stderr] (Thread-169) at
org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:217)
10:41:13,008 ERROR [stderr] (Thread-169) ... 5 more
Could anyone indicate how to fix this?
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-4-Jitting-Error-tp3999176.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Using Guvnor with Seam
by rjr201
Hi,
I'm very interested in using Drools Guvnor with Seam and was hoping someone
here may have some experience of doing this.
I've currently got Seam 2.3 working fine with Guvnor 5.3. My question is, is
it possible to get Seam 2.3 working with Guvnor 5.5? Or is it necessary to
move onto Seam 3 in order to do this?
>From my understanding, the drools libraries that come with Seam 2.3 aren't
compatible with versions of Guvnor later than 5.3. I've experimented with
replacing Seam's drools libraries with the latest drools libraries (as used
by Guvnor 5.5) but then Seam complains, as it requires the older drools
libraries for some of it's internal workings.
Any advice/experience with this would be greatly appreciated.
Rich.
--
View this message in context: http://drools.46999.n3.nabble.com/Using-Guvnor-with-Seam-tp4021210.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Collecting items in a List
by devan.vanreenen@gmail.com
Hi there,
I have checked existing posts and able to find problems which are similar to
mine but not exactly.
I have an Alert object as per below, several alert instances may have the
same caseNumber
I am trying to collect all the Alert instances that have the same
caseNumber, the rule is below, the rule below collects the items correctly
but the execution happens for each Alert object inserted into the knowledge
session. How can I get around this?
public class Alert {
int caseNumber;
short alertNo;
public int getCaseNumber() {
return caseNumber;
}
public void setCaseNumber(int caseNumber) {
this.caseNumber = caseNumber;
}
public short getAlertNo() {
return alertNo;
}
public void setAlertNo(short alertNo) {
this.alertNo = alertNo;
}
@Override
public String toString() {
return "Alert [caseNumber=" + caseNumber + ", alertNo=" + alertNo + "]";
}
}
rule 'Collect Alerts for a specific case'
dialect 'java'
when
Alert( $caseNumber : caseNumber)
$list : List( ) from collect($alertalert : Alert( caseNumber ==
$caseNumber))
then
for(Object a : $list){
System.out.println(a);
}
end
I insert 5 alert objects as per below
Alert alert1 = new Alert();
alert1.setAlertNo((short)1);
alert1.setCaseNumber(830826);
Alert alert4 = new Alert();
alert4.setAlertNo((short)4);
alert4.setCaseNumber(830826);
Alert alert7 = new Alert();
alert7.setAlertNo((short)7);
alert7.setCaseNumber(830826);
Alert alert3 = new Alert();
alert3.setAlertNo((short)3);
alert3.setCaseNumber(820424);
Alert alert5 = new Alert();
alert5.setAlertNo((short)5);
alert5.setCaseNumber(820424);
I would like the output to be as follows
Alert [caseNumber=820424, alertNo=3]
Alert [caseNumber=820424, alertNo=5]
Alert [caseNumber=830826, alertNo=7]
Alert [caseNumber=830826, alertNo=4]
Alert [caseNumber=830826, alertNo=1]
but instead the output is
Alert [caseNumber=820424, alertNo=5]
Alert [caseNumber=820424, alertNo=5]
Alert [caseNumber=820424, alertNo=3]
Alert [caseNumber=820424, alertNo=5]
Alert [caseNumber=820424, alertNo=3]
Alert [caseNumber=830826, alertNo=7]
Alert [caseNumber=830826, alertNo=7]
Alert [caseNumber=830826, alertNo=4]
Alert [caseNumber=830826, alertNo=7]
Alert [caseNumber=830826, alertNo=4]
Alert [caseNumber=830826, alertNo=7]
Alert [caseNumber=830826, alertNo=4]
Alert [caseNumber=830826, alertNo=1]
Alert [caseNumber=830826, alertNo=7]
Alert [caseNumber=830826, alertNo=4]
Alert [caseNumber=830826, alertNo=1]
Alert [caseNumber=830826, alertNo=7]
Alert [caseNumber=830826, alertNo=4]
Alert [caseNumber=830826, alertNo=1]
--
View this message in context: http://drools.46999.n3.nabble.com/Collecting-items-in-a-List-tp4021256.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Unknown execution error: jitting
by David R Robison
I have a rule that runs fine when I execute it inside Guvnor in a Test
Scenario but when I run it in production I get the following error.
Exception in thread "Thread-24" java.lang.RuntimeException: Exception
jitting: $incidentRoutingIncreasing.isIncreasing &&
$sign.routeMileMarker > routeMileMarker ||
!$incidentRoutingIncreasing.isIncreasing && $sign.routeMileMarker <
routeMileMarker
at
org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:219)
at
org.drools.rule.constraint.MvelConstraint.access$000(MvelConstraint.java:41)
at
org.drools.rule.constraint.MvelConstraint$1.run(MvelConstraint.java:201)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.VerifyError: (class:
ConditionEvaluatorebdfa6ebae044e95bc706dfcd6f5654a, method: evaluate
signature:
(Ljava/lang/Object;Lorg/drools/common/InternalWorkingMemory;Lorg/drools/reteoo/LeftTuple;)Z)
Expecting to find integer on stack
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
at java.lang.Class.getConstructor0(Class.java:2714)
at java.lang.Class.getConstructor(Class.java:1674)
at
org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:173)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter.jitEvaluator(ASMConditionEvaluatorJitter.java:53)
at
org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:217)
... 5 more
The rule does seem to fire. Any idea what it is trying to tell me or any
hints on how to debug this?
TNX David
--
David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison(a)openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526
This email communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.
If you are not the intended recipient, please delete this email immediately.
12 years
drools-expert: Log atomic assertions !?
by bholzer
Is wonder how to log atomic assertions (i.e. the results of the Rete-Nodes -
visits ) ?
I tried the three Debug*EventListeners, but they're too coarse-grained.
As a workaround, I patched org.drools.reteoo.AlphaNode.assertObject(...) as
follows:
public void assertObject(...) {
final AlphaMemory memory = (AlphaMemory)
workingMemory.getNodeMemory( this );
boolean allowed = this.constraint.isAllowed(factHandle,
workingMemory, memory.context );
*log("Eval of " + this.constraint + " on " + factHandle.getObject()
+ ":" + allowed);*
if ( allowed ) {
this.sink.propagateAssertObject(factHandle, context,
workingMemory);
}
}
Is there a better way to archieve my goal ?
--
View this message in context: http://drools.46999.n3.nabble.com/drools-expert-Log-atomic-assertions-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years
Drools Planner - split and join parallelism
by Willem van Asperen
Hi All,
I have an idea that I would like to bounce of the list.
As far as I understand, Drools Planner does not do any parallel
searching. It uses a single solver thread that does all the work.
What if I would forage not only the best solution so far, but a couple
of "promising" solutions and split these off to run on a separate
thread. I would split these itteratively down to a given level of iteration.
When these threads return I would then pick the best solution from the
returned values.
Using a multi-core box or even a server farm I could massively increase
the searched problem space and do it without loosing too much time (some
parallel management overhead).
Has anyone thought of such scheme before? Any luck in implementing?
Do you see any flaws?
Just a thought.
Regards,
Willem
12 years