Drools Roadmap - Planned Release 5.1 release date
by McDonald, Daniel
Hi,
I was wondering if there is a planned release date for Release 5.1?
Thank you,
Daniel McDonald
Fidelity National Information Services - Research & Development
Office phone: (972) 691-6593
Mobile phone (214) 697-8163
_____________
The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________
14 years, 6 months
ANT Compile issues
by Bhamidi, Krishna
Hi,
I am using DROOLs 5.0.0 CR1 and use the compiler from Drools-Ant. When I attempt to execute the rules using a rule agent, I get an exception that in part reads
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
(Full stack follows this e-mail.) However, when I download the pkg file for the same ruleset from Guvnor and use it in the rule agent, it runs fine.
I use the following for building -
<taskdef name="compiler" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="compiler.classpath" />
<compiler srcdir="../${rulesDirectory}" tofile="../${buildDirectory}/${projectName}_rules.pkg"
classpath="../${buildDirectory}/${projectName}_rules.jar"
binformat="package">
<include name="*.drl" />
<include name="*.brl" />
<include name="*.xml" />
<include name="*.dslr" />
<include name="*.xls" />
</compiler>
What I should do to compile correctly?
Full Stack
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:41)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.Package.readExternal(Package.java:197)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:158)
at org.drools.agent.FileScanner.readPackage(FileScanner.java:136)
at org.drools.agent.FileScanner.getChangeSet(FileScanner.java:82)
at org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:56)
at org.drools.agent.DirectoryScanner.loadPackageChanges(DirectoryScanner.java:69)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:410)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:362)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
14 years, 6 months
Extending the "validation of rules" functionality in Guvnor
by Premkumar Stephen
Hello everyone,
Currently, the validate functionality ensures that rules have proper
syntax.
it is possible to extend this functionality so that business use cases might
also be validated? Is there an API/examples to do that.
For eg, in our domain, an object X can be evaluated for 3 criteria ( a, b,
c )
However, we would need to prevent rules written which combine criteria b and
c
Rules can have the combinations ( a,b,c, ab, ac ). Combinations ( bc and abc
) should not be allowed.
Regards,
Prem
14 years, 7 months
Issue with drools-flow/persistence
by Daniel Ilkovich
I'm stumped. I'm trying to implement persistence with Drools-flow, and I'd
like to grab the value of a property on a workitem / processinstance, but
everytime I try to get the workitem or process instance I end up with the
stack trace below.
I'm walking through the source and from what I can tell, this happens
anytime I try and grab a property that is annotated with @Lob in an entity
class.
My environment is hibernate/mysql/JPA persistence using BTM as a transaction
manager.
These are the relevant lines of code:
ksession =
JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), m_kbase ,
null, m_environment);
m_pi = ksession.getProcessInstance(m_pi.getId());
What am I doing wrong?
<pre>
<code>
java.lang.NullPointerException
at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)
at
org.drools.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:135)
at
org.drools.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:62)
at
org.drools.common.AbstractWorkingMemory.getProcessInstance(AbstractWorkingMemory.java:1793)
at
org.drools.impl.StatefulKnowledgeSessionImpl.getProcessInstance(StatefulKnowledgeSessionImpl.java:261)Hibernate:
select at
org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:29)
at
org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:12)
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254)
at
org.drools.command.impl.CommandBasedStatefulKnowledgeSession.getProcessInstance(CommandBasedStatefulKnowledgeSession.java:95)
at
com.thoughtvine.tracks.workflow.TracksFlow.getParameterFromWorkItem(TracksFlow.java:182)
at
com.thoughtvine.tracks.workflow.test.TestTracksFlow.testGetWorkItem(TestTracksFlow.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
</code>
</pre>
14 years, 7 months
Performance of compiler
by Christian Nedregård
Hi.
My environment: Win XP SP3, 2x2.13 GHz cpu, 3GB RAM, Drools 4.0.7, JDK
1.4.2_11, java compiler: JANINO, dialect: java.
We have about 850 drl's with 5 - 10 conditions in each. 0 -2 evals in each.
The drl's only contain one rule each.
We are using Drools programatically by compiling the drls using
PackageBuilder.addPackageFromDrl and adding them to a RuleBase using
RuleBase.addPackage(PackageBuilder.getPackage())
When we are building our rule base we are never able to compile more than 1
-2 rules per second, which means we need over 10 minutes (at 100% cpu) to
build our rulebase.
Profiling shows 68% cpu time in
org.drools.rule.builder.GroupElementBuilder.build and 18% cpu time in
org.codehaus.janino.Compiler.compile.
We have experimented by changing the compiler to ECLIPSE and the dialect to
mvel but the results are the same.
We have experimented using one PackageBuilder instance per drl or grouping
drls by package and sharing a builder per package. Same result in both
scenarios.
We have also expermimented with compiling concurrently in serveral threads.
Again, about the same result.
My question is: Is this the performance we can expect from the compiler or
are we doing something fundamentally wrong?
Below is an example of one of our drls. This one contains no evals, but
still takes more than 1 second to compile. If anyone can spot some issues
with the way we are doing things the feedback would be much apreciated :)
------------------------------------
package domain.core.productoffer.rules.subscriptiontype
import type.productoffer.ProductOfferRuleEvent
import domain.core.subscription.Subscription
import domain.core.subscription.SubscribedService
import type.subscription.ActionTypeEnum
import domain.core.productoffer.ProductOffer
import domain.rules.RuleEvent
global domain.core.productoffer.RuleValidationReport validationResult
rule "RequiredVProducts"
when
ProductOfferRuleEvent(id == '3')
ProductOffer(id.value == 31963)
$subscription:Subscription()
not ( SubscribedService(status != ActionTypeEnum.REMOVE_CANCEL &&
productId.value in (57, 69) ) from
$subscription.getAllChildSubscribedServices())
then
validationResult.addValidationMessage("2069", "For product offer
rule event with id '3' and product offer with id=31963 subscription must
have one of the following VProducts: 57, 69.");
end
------------------------------------
Regards
Christian Nedregård
14 years, 8 months
Call class method from LHS of a rule
by orchid
Hi All,
I'm trying to call a class method from the LHS of a rule in the following
way:
public class Cheese{
private string type;
//setters and getters
public boolean existsInShop(String shop){
...
return true;
}
}
I would like to call the method "existsInShop" from a rule:
Rule "Rule1"
when
$c:Cheese(type == "chedar", existsInShop "shopName")
then
System.out.println("Rule1 is fired");
end
I get the compilation error: "no viable alternative at input "shopName" in
rule "Rule1" in pattern document". How can I call the method from the rule?
Thanks in advance.
--
View this message in context: http://n3.nabble.com/Call-class-method-from-LHS-of-a-rule-tp108383p108383...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months
Rules categorization/packages
by Amit Kumar
Hello All,
I am looking to organize the rules in different categories. But for
distribution purposes We are creating packages for different
roles/processing phases
So a rule will reside in one pckage but for navigation it can belong to
multiple categories
So packages are like Shirts, Pants, Shoes, Sweaters
Categories are Color, Material, Size, Gender and those have sub categories
witin them
We have rules which will device the category of the item
Like "red rule", "blue rule", "cloth rule", leather rule"
Now the problem we are facing is for category rules is if I define the rule
in Shirt package .. then I will not be able ot use it in Pant package.. Will
have to redefine it.
The other problem in this scenario is If I have a price rule in Shirt
package and the category is "Blue Color" and "XL Size" then I will have to
put it in both categories
When I put the "Blue Rule" on "Blue Category" and "XL Rule" on "XL
Category" and I put the rule in both categories.. will it be an "and"
relationship or will be an "OR"
Regards,
Amit
14 years, 8 months
Task Server gives error cannot use getTransaction()
by Todd Pagni
When I configure the Task Server(org.drools.task) to be JTA I get the
following error when adding a Human Task work item. Is the following
Persistence Unit configuration valid? It works when the org.drools.task
trans type is set to LOCAL_RESOURCE.
Using drools 5.1.0.M1 in JBoss 5.1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.drools.persistence.jpa"
transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/processInstanceDS</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
<class>org.drools.persistence.session.SessionInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceInfo</class
>
<class>org.drools.persistence.processinstance.WorkItemInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.JPAPersisted
Variable</class>
<class>org.drools.persistence.processinstance.variabletypes.VariableInst
anceInfo</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3"
/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update"
/>
<property name="hibernate.connection.release_mode"
value="auto" />
<property
name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/WorkflowServerPU" />
</properties>
</persistence-unit>
<persistence-unit name="org.drools.task" transaction-type="
RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/processInstanceDS</jta-data-source>
<mapping-file>META-INF/taskorm.xml</mapping-file>
<class>org.drools.task.Attachment</class>
<class>org.drools.task.Content</class>
<class>org.drools.task.BooleanExpression</class>
<class>org.drools.task.Comment</class>
<class>org.drools.task.Deadline</class>
<class>org.drools.task.Comment</class>
<class>org.drools.task.Deadline</class>
<class>org.drools.task.Delegation</class>
<class>org.drools.task.Escalation</class>
<class>org.drools.task.Group</class>
<class>org.drools.task.I18NText</class>
<class>org.drools.task.Notification</class>
<class>org.drools.task.EmailNotification</class>
<class>org.drools.task.EmailNotificationHeader</class>
<class>org.drools.task.PeopleAssignments</class>
<class>org.drools.task.Reassignment</class>
<class>org.drools.task.Status</class>
<class>org.drools.task.Task</class>
<class>org.drools.task.TaskData</class>
<class>org.drools.task.SubTasksStrategy</class>
<class>org.drools.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.drools.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.drools.task.User</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3"
/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update"
/>
<property name="hibernate.connection.release_mode"
value="auto" />
<property
name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/WorkflowServerPU" />
</properties>
</persistence-unit>
</persistence>
10:48:22,887 INFO [STDOUT] Hibernate: update WorkItemInfo set
creationDate=?, name=?, processInstanceId=?, state=?, OPTLOCK=?,
workItemByteArray=? where workItemId=? and OPTLOCK=?
10:48:22,887 INFO [STDOUT] [2010:01:20 10:01:887:debug] Message
receieved on server : AddTaskRequest
10:48:22,887 INFO [STDOUT] [2010:01:20 10:01:887:debug] Arguments :
[org.drools.task.Task@537c3c9e,
org.drools.task.service.ContentData@b2a90]
10:48:22,887 INFO [STDOUT] [2010:01:20 10:01:887:exception] A JTA
EntityManager cannot use getTransaction()
10:48:22,887 INFO [STDOUT] java.lang.IllegalStateException: A JTA
EntityManager cannot use getTransaction()
10:48:22,887 INFO [STDOUT] at
org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntit
yManagerImpl.java:324)
10:48:22,887 INFO [STDOUT] at
org.drools.task.service.TaskServiceSession.doOperationInTransaction(Task
ServiceSession.java:676)
10:48:22,887 INFO [STDOUT] at
org.drools.task.service.TaskServiceSession.addTask(TaskServiceSession.ja
va:118)
10:48:22,887 INFO [STDOUT] at
org.drools.task.service.TaskServerHandler.messageReceived(TaskServerHand
ler.java:88)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.message
Received(DefaultIoFilterChain.java:752)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(Defaul
tIoFilterChain.java:49)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messag
eReceived(DefaultIoFilterChain.java:832)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputIm
pl.flush(ProtocolCodecFilter.java:379)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Protoco
lCodecFilter.java:173)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(Defaul
tIoFilterChain.java:49)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messag
eReceived(DefaultIoFilterChain.java:832)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilt
er.java:95)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(Defaul
tIoFilterChain.java:49)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messag
eReceived(DefaultIoFilterChain.java:832)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$HeadFilter.message
Received(DefaultIoFilterChain.java:616)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceive
d(DefaultIoFilterChain.java:408)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPol
lingIoProcessor.java:578)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(Abstract
PollingIoProcessor.java:540)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(Abstract
PollingIoProcessor.java:532)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(Abstr
actPollingIoProcessor.java:58)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.core.polling.AbstractPollingIoProcessor$Worker.run(Abstr
actPollingIoProcessor.java:857)
10:48:22,887 INFO [STDOUT] at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.j
ava:51)
10:48:22,887 INFO [STDOUT] at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:651)
10:48:22,887 INFO [STDOUT] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:676)
10:48:22,887 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
10:48:22,887 ERROR [STDERR] java.lang.IllegalStateException: A JTA
EntityManager cannot use getTransaction()
10:48:22,887 ERROR [STDERR] at
org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntit
yManagerImpl.java:324)
10:48:22,887 ERROR [STDERR] at
org.drools.task.service.TaskServiceSession.doOperationInTransaction(Task
ServiceSession.java:676)
10:48:22,887 ERROR [STDERR] at
org.drools.task.service.TaskServiceSession.addTask(TaskServiceSession.ja
va:118)
10:48:22,887 ERROR [STDERR] at
org.drools.task.service.TaskServerHandler.messageReceived(TaskServerHand
ler.java:88)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.message
Received(DefaultIoFilterChain.java:752)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(Defaul
tIoFilterChain.java:49)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messag
eReceived(DefaultIoFilterChain.java:832)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputIm
pl.flush(ProtocolCodecFilter.java:379)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Protoco
lCodecFilter.java:173)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(Defaul
tIoFilterChain.java:49)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messag
eReceived(DefaultIoFilterChain.java:832)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilt
er.java:95)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(Defaul
tIoFilterChain.java:49)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messag
eReceived(DefaultIoFilterChain.java:832)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain$HeadFilter.message
Received(DefaultIoFilterChain.java:616)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageRec
eived(DefaultIoFilterChain.java:414)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceive
d(DefaultIoFilterChain.java:408)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPol
lingIoProcessor.java:578)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(Abstract
PollingIoProcessor.java:540)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(Abstract
PollingIoProcessor.java:532)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(Abstr
actPollingIoProcessor.java:58)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.core.polling.AbstractPollingIoProcessor$Worker.run(Abstr
actPollingIoProcessor.java:857)
10:48:22,887 ERROR [STDERR] at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.j
ava:51)
10:48:22,887 ERROR [STDERR] at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:651)
10:48:22,887 ERROR [STDERR] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:676)
10:48:22,887 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
10:48:22,903 INFO [LoggingFilter] SENT: HeapBuffer[pos=0 lim=2200
cap=4096: 00 00 08 94 AC ED 00 05 73 72 01 00 1F 6F 72 67...]
10:48:22,903 INFO [LoggingFilter] SENT: HeapBuffer[pos=0 lim=0 cap=0:
empty]
10:48:22,903 INFO [STDOUT] [2010:01:20 10:01:903:debug] Message
receieved on client : AddTaskResponse
10:48:22,903 INFO [STDOUT] [2010:01:20 10:01:903:debug] Arguments :
[java.lang.IllegalStateExcep
14 years, 8 months
"from" keyword does not actually check types?
by Jevon Wright
Hi,
I am using Drools 4.0.7, and I had a DRL rule similar to the following:
rule "..."
when
other : Foo( )
x : Bar( ) from other.property
then
...
end
An unexpected bug occured. In some situations, other.property would _not_ be
of type Bar, yet Drools would still think that it was. As a result I was
getting some unusual exceptions being thrown: "org.mvel.CompileException:
unable to resolve property: ..."
If I changed the rule to:
x : Bar( ) from other.property
eval ( x instanceof Bar )
It would instead throw a ClassCastException (i.e. "Baz cannot be cast into
Bar").
If, instead, I changed the rule to:
x : Bar( other.property == x )
It would start working correctly, and 'x' would only be of type Bar.
Is this known behaviour? Is it expected? If so, I would appreciate it if the
4.0.7 documentation was updated to reflect that "from" actually ignores the
return type of properties. It took me a couple of hours to detect and fix
this bug.
I would try these rules in Drools 5.x, but I'm still waiting for the
blocking JBRULES-2218 to be resolved.
Cheers
Jevon
14 years, 9 months