Re: [rules-users] rules-users Digest, Vol 38, Issue 58
by Axelrod, Nelson
Hi Edson,
Yes, you guessed right. We are using drools 5.0.1.
Exception in thread "main"
org.jcvi.annotation.rulesengine.RulesResourceException: Could not parse
resource in [FileResource
file='C:\development\workspace\RulesBasedAnnotation\tests\org\jcvi\annot
ation\rules\testNestedOr.drl'] with errors
[14,4]: [ERR 101] Line 14:4 no viable alternative at input 'blast_hit'
in rule "2645|lysine decarboxylase CadA" in pattern or[22,2]: [ERR 102]
Line 22:2 mismatched input ')' expecting 'then' in rule "2645|lysine
decarboxylase CadA"
at
org.jcvi.annotation.rulesengine.RulesEngine.addResource(RulesEngine.java
:103)
at
org.jcvi.annotation.rulesengine.RulesEngine.addResource(RulesEngine.java
:83)
at org.jcvi.annotation.Aruba.addRuleByFile(Aruba.java:68)
at org.jcvi.annotation.Aruba.main(Aruba.java:253)
Thank you in advance for your help,
Nelson
------------------------------
Message: 2
Date: Tue, 19 Jan 2010 11:43:32 -0500
From: Edson Tirelli <ed.tirelli(a)gmail.com>
Subject: Re: [rules-users] nested boolean expressions using prefixOr
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<e6dd5ba31001190843u484568a5q150c6eda77ed004d(a)mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"
Nelson,
Can you provide details on which exact version of drools (5.0.1?) you
are
using and what is the error/stack trace you are receiving?
Thanks,
Edson
14 years, 11 months
How to call a method from a cell in Drools 5 decision table?
by jos@circuitdb.com
I'm migrating an application from drools 4 to drools 5. I encountered some
problems where our decision table uses calls to methods with String
parameters in actions cells.
I've reproduces the issue in the example decision table project generated
by the eclipse plugin. After generating a new Drools project with decision
table example I added the following to the Message class:
public String getMessage(String dummy) {
return this.message;
}
In the decision table I change cell E9 from
'm.setMessage("$param");update(m);' to 'm.setMessage($param);update(m);'
and cell E11 from 'Goodbye cruel world' to 'm.getMessage("msg")'.
When I use this java and xls file with Drools 4 I get the folloowing at
line 11 of the drl:
m.setMessage(m.getMessage("msg"));update(m);
But when I use Drools 5 I get escaped double-quotes which causes an error
in com.sample.DecisionTableTest.readKnowledgeBase:
m.setMessage(m.getMessage(\"msg\"));update(m);
I have attached the java code, xls sheet and both generated drl files.
Thanks in advance.
14 years, 11 months
nested boolean expressions using prefixOr
by Axelrod, Nelson
Hi,
I've encountered problems constructing nested Boolean expressions in
Drools 5.0 using the prefixOr syntax. We're using Drools to build a
genome annotation system at the Venter Institute. The following
example rule assigns an annotation if there is a blast hit to a gene
GB|AAQ16631.1, or either a blast hit to gene GB|AAQ16631.1, or to any
gene within 500 bases of a gene with an HMM hit to TIGR00905. I've left
off some details to focus on how we are structuring the syntax of our
prefixOr and prefixAnd expressions.
The Drools parser throws errors when it encounters the 2nd "blast_hit"
statement in the example below. Our prefixOr and prefixAnd expressions
work as expected when we use similar syntax, at least until we attempt
to use nested or expressions.
rule "2645|lysine decarboxylase CadA"
when
(or
(and
blast_hit : BlastHit( hitId=='GB|AAQ16631.1')
gene1 : Feature( featureId == blast_hit.queryId )
)
(or
(and
blast_hit : BlastHit( hitId=='GB|AAQ16631.1' )
gene1 : Feature( featureId == blast_hit.queryId
)
)
(and
hmm_hit1 : HmmHit( hitId=='TIGR00905' )
gene1 : Feature( featureId == hmm_hit1.queryId )
gene2 : Feature( eval(gene2.isWithin(gene1,
500)) )
)
)
)
then
Annotation a = new Annotation("lysine decarboxylase CadA");
gene1.addAnnotation(a);
end
Any suggestions are much appreciated.
Thanks,
Nelson
14 years, 11 months
Rule task problem
by Kevin Alonso
Hello all,
I´m working with drools 5.1M flow and when I run the flow, before the
start, I get this message:
(null: 42, 168): cvc-complex-type.3.2.2: Attribute 'implementation' is
not allowed to appear in element 'businessRuleTask'.
Then the flow executes until rule task node and finally it exits,
without errors, but without finishing the flow too.
The line referred in bpmn file is:
<businessRuleTask id="_14" name="Propose Classifier" g:x="48" g:y="493"
g:width="126" g:height="48" g:ruleFlowGroup="Propose Classifiers"
implementation="Other"/>
Could you help me with this?
Thank you in advance,
Kevin.
--
Vicomtech
Kevin Alonso González
Investigador / Researcher
Televisión Digital y Servicios Multimedia /
Digital TV & Multimedia Services
kalonso(a)vicomtech.org
Mikeletegi Pasealekua, 57 - Parque Tecnológico
20009 Donostia - San Sebastián - Spain
Tel: +[34] 943 30 92 30
Fax: +[34] 943 30 93 93
www.vicomtech.org
14 years, 11 months
NullPointerException with Parameter Mapping in HumanTask or custom tasks
by Dirk
Hi Drools-User,
I have a big problem with custom human task and custom workItems. I have a
simple testprocess with just one variable called SessionId (type = Integer)
and one Human Task with a custom WorkItemHandler which just print the
parameter "workitem" to the stdout.
For the persistence aspect I use the standard persister:
JPAVariablePersister and SerializableVariablePersister (and of course
JPAKnowledgeService).
Without a Mapping-Parameter my process works fine and with a parameter I get
a error. Do you have an Idea? I need parameter to connect with our
application (using the standard-handler is not practicable...).
java.lang.NullPointerException
at
org.drools.marshalling.impl.MarshallerReaderContext.resolveClass(MarshallerReaderContext.java:78)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at
org.drools.marshalling.impl.InputMarshaller.readWorkItem(InputMarshaller.java:830)
at
org.drools.persistence.processinstance.WorkItemInfo.getWorkItem(WorkItemInfo.java:86)
at
org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:90)
at
org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:46)
at
org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:1)
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254)
at
org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:121)
at com.sample.ProcessTest.step2(ProcessTest.java:99)
at com.sample.ProcessTest.main(ProcessTest.java:42)
java.lang.RuntimeException: Could not rollback transaction
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:283)
at
org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:121)
at com.sample.ProcessTest.step2(ProcessTest.java:99)
at com.sample.ProcessTest.main(ProcessTest.java:42)
Caused by: java.lang.RuntimeException: Could not execute command
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:280)
... 3 more
Caused by: java.lang.NullPointerException
at
org.drools.marshalling.impl.MarshallerReaderContext.resolveClass(MarshallerReaderContext.java:78)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at
org.drools.marshalling.impl.InputMarshaller.readWorkItem(InputMarshaller.java:830)
at
org.drools.persistence.processinstance.WorkItemInfo.getWorkItem(WorkItemInfo.java:86)
at
org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:90)
at
org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:46)
at
org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:1)
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254)
... 3 more
http://n3.nabble.com/file/n130042/Freigabe.rf Freigabe.rf
http://n3.nabble.com/file/n130042/ProcessTest.java ProcessTest.java
http://n3.nabble.com/file/n130042/UsWSHandler.java UsWSHandler.java
--
View this message in context: http://n3.nabble.com/NullPointerException-with-Parameter-Mapping-in-Human...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 11 months
Setting a Flow Variable from a Rule
by Todd Pagni
How do you set a flow variable (not global) from inside a rule so it is
available for nodes that follow the rule execution? I cannot seem to
find this in the doc.
Previously I had a Person() fact that was also passed into the flow as a
variable, when I modified the fact Person() object it was reflected in
the flow variable, but the latest snapshot seems to have broken this so
I am looking for alternatives.
Thanks,
Todd
14 years, 11 months