<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.java.drools.user">
    <title>gmane.comp.java.drools.user</title>
    <link>http://blog.gmane.org/gmane.comp.java.drools.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13115"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13114"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13113"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13112"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13111"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13110"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13109"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13108"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13107"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13106"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13105"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13104"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13103"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13102"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13101"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13100"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13099"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13098"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13097"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.drools.user/13096"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13115">
    <title>RE: ClassCastException when firing rules</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13115</link>
    <description>FYI: Spring AOP enhances objects via CGLIB when no interface is available.
If an interface is avaiable, it uses an jdk dynamic proxy.  

-----Original Message-----
From: rules-users-bounces&lt; at &gt;lists.jboss.org
[mailto:rules-users-bounces&lt; at &gt;lists.jboss.org] On Behalf Of seemamani
Sent: Wednesday, November 26, 2008 11:18 AM
To: rules-users&lt; at &gt;lists.jboss.org
Subject: Re: [rules-users] ClassCastException when firing rules


Edson,

We are not sure how the CGLIB proxy is getting created. We were under the
impression that it is the shadow fact proxy generated by Drools itself. I
would like to share a few more points about our application in case they
are
somehow related to this problem.

1. We are using Spring AOP for intercepting method calls and passing the
facts, globals etc to a class that invoke Drools. Version of Spring is
2.0.7
2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory
POJO that is causing the ClassCastException is a JPA entity
3. We have rules defined in multiple packages. The Inventory POJO is used
by
rules in all the packages. But the exception is occurring only for rules
in
a particular package. That too only occasionally.

Please let me know if any other information is required.

Thanks,
Seema


Edson Tirelli-3 wrote:
prevented
6.1.
of
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216
)
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
teObjectSinkAdapter.java:318)
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
teObjectSinkAdapter.java:318)
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71
)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
911)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
883)
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
684)
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.i
nit(ManagedStatefulSession.java:87)
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.f
ireAllRules(ManagedStatefulSession.java:100)
com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(R
uleEngineImpl.java:60)
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnot
edRules(RulesInterceptor.java:109)
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules
(RulesInterceptor.java:80)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
thGivenArgs(AbstractAspectJAdvice.java:597)
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
bstractAspectJAdvice.java:583)
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
vice.java:60)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
oseInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor
.intercept(Cglib2AopProxy.java:629)
com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdateP
ricing(&lt;generated&gt;)
com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(Sale
EventManagerImpl.java:2599)
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuct
ion(SaleEventManagerImpl.java:1993)
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEvent(SaleEventManagerImpl.java:1180)
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEvent(SaleEventManagerImpl.java:1134)
com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGround
ingSaleEvent(AuctionServiceImpl.java:766)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Ao
pUtils.java:304)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoi
nt(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.procee
d(MethodInvocationProceedingJoinPoint.java:77)
com.adesa.business.framework.logging.LoggingInterceptor.profileLog(Logging
Interceptor.java:136)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
thGivenArgs(AbstractAspectJAdvice.java:597)
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
bstractAspectJAdvice.java:583)
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
vice.java:60)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.
invoke(AfterReturningAdviceInterceptor.java:50)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
fterThrowingAdvice.java:54)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.in
voke(MethodBeforeAdviceInterceptor.java:50)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
fterThrowingAdvice.java:54)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
oseInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopP
roxy.java:204)
com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java
:112)
com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMB
PPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.upd
ateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._in
voke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.jav
a:621)
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableD
eepPropertyNode.java:22)
org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.ja
va:21)
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.ja
va:21)
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpress
ion.java:45)
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209
)
http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p2069
4738.html

</description>
    <dc:creator>Dean Turner</dc:creator>
    <dc:date>2008-12-01T21:59:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13114">
    <title>Proper termination of a CommandService</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13114</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Michal Bali</dc:creator>
    <dc:date>2008-12-02T00:24:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13113">
    <title>Re: function problem</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13113</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Edson Tirelli</dc:creator>
    <dc:date>2008-12-01T21:51:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13112">
    <title>Re: JCR to SVN.</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13112</link>
    <description>Please don't email me directly, these sort of questions should go on the 
user mailing list (in cc), so everyone can benefit. There is some 
unfinished work for drools-repository synchronisation for svn. Currently 
it only works for getting stuff from SVN into JCR, the other way around 
still needs completing. There are unit tests for the svn-&gt;jcr direction.
http://fisheye.jboss.org/browse/JBossRules/trunk/drools-repository/src/main/java/org/drools/scm
http://fisheye.jboss.org/browse/JBossRules/trunk/drools-repository/src/test/java/org/drools/scm

Mark


_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Mark Proctor</dc:creator>
    <dc:date>2008-12-01T18:49:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13111">
    <title>Re: function problem</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13111</link>
    <description>
Charlie,
I'm not sure why your function doesn't compile as it looks fine to me. Do
you have any other details about the message you're getting from the
compiler?

In any case, you may want to consider solving the problem a different way.
In general, you should try to avoid "eval" statements whenever possible as
they can severely hamper performance. Edson wrote up some helpful hints -
see "Eval is Evil" at -
http://blog.athico.com/2007/03/writing-better-rules.html

As an alternative, try populating working memory with each of the Person's
tagList items and then use "memberOf" to determine if it's one of the
engineering TagCodes. (You may be able to use the "from" statement with the
Person's tagList instead of populating working memory) This allows Drools to
do all of the work for you and may very well be faster than using loops.

Let me know if you need further clarification.


Charlie Holland wrote:

</description>
    <dc:creator>Dan Seaver</dc:creator>
    <dc:date>2008-12-01T18:48:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13110">
    <title>Re: Precompilation of Rule Flows</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13110</link>
    <description>[The following answers are based on the latest Drools 5 M3 code.]

Correct.  There are of course performance implications.  If you have a very 
simple
constraint like x &gt; 3 (where x is for example a process variable), we 
recommend
simply using a code constraint. Rule constraints however do offer you a more
expressive constraint language and can reason about data in the working 
memory
as well.  This however has a small performance inpact.

There seems to be an error where rule compilation errors are not always 
shown
by the Drools Builder.  I have however just fixed this in trunk.  This means 
that
any errors in the process should now be detected by the Drools builder, and 
are also
added to the packageBuilder errors.  So runtime exceptions should not occur 
if
you check for errors after parsing.  Could you open a JIRA or send me the
ruleflow if you find an error that is still not detected during compilation?

This is also supported in the latest Drools 5 M3.  Note that you will first 
need to
import the necessary fact classes to get useful code completion in rule 
constraints.

Kris 

_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Kris Verlaenen</dc:creator>
    <dc:date>2008-12-01T18:07:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13109">
    <title>Precompilation of Rule Flows</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13109</link>
    <description>
I have a number of questions as it relates the creation of rule flows:

1) I am assuming that when creating the constraints within a given node
within a rule flow that the selection of "rule"  as the type will create a
rule behind the scenes while selection of "code" will create some java
object representation? If this is a correct understanding is there any
preference from an engine perspective, are there performance or other
considerations that must be taken into account?

2) Is there any way to precompile rule flows like rule files are (as opposed
to at runtime with a call to packageBuilder.addRuleFlow(source))? With the
Drools builder any errors in the .drl files are highlighted. Not so with the
.rf. In order to see what is generated it appears that you have to step
through in debug mode at runtime and buried inside there is a string
representation of everything that was generated as well a list of errors
which refer to errors such as parse errors. Unfortunately this manifests
itself eventually (at least with my flow) as a NullPointerException giving
absolutely no indication as to the root of the problems, which I am assuming
are these parser errors. Seems to me that these errors should be returned
with a call to packageBuilder.hasErrors() which is empty in my case.
3) Code assist doesnt appear to work in action editor or constraint editor
which is I think is a pretty big usablity issue. Anything planned to make
this available?

Thanks
</description>
    <dc:creator>keithnielsen</dc:creator>
    <dc:date>2008-12-01T16:47:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13108">
    <title>RE: drools 4.0 and enum in java 1.5</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13108</link>
    <description>
In your rule this line:

msg : Message(type == "XML", payload : payload)

is incorrect. You're trying to match an enum, not a String.

Try this:

msg : Message(type == Type.XML, payload : payload)

-Allen
 

-----Original Message-----
From: rules-users-bounces&lt; at &gt;lists.jboss.org [mailto:rules-users-bounces&lt; at &gt;lists.jboss.org] On Behalf Of Thierry B
Sent: Monday, December 01, 2008 8:03 AM
To: Rules Users List
Subject: RE: [rules-users] drools 4.0 and enum in java 1.5


Hello,

I've these imports :

import com.pv.rules.beans.Message;
import com.pv.rules.beans.Message.Type.XML;

but it tell me :

Unable to create restriction '[QualifiedIndentifierRestr: == com.pv.rules.beans.Message.Type.XML ]' for field 'type' in the rule 'Contexte1' : [Rule name=Contexte1, agendaGroup=MAIN, salience=0, no-loop=false] Rule Compilation error : [Rule name=Contexte1, agendaGroup=MAIN, salience=0, no-loop=false]
com/pv/rules/Rule_Contexte1_0.java (2:63) : The import com.pv.rules.beans.Message.Type.XML cannot be resolved com.pv.rules.beans.Message.Type.XML

Maybe, it's not possible to use enum in drl :-(

Thanks :-)


_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Bagwell, Allen F</dc:creator>
    <dc:date>2008-12-01T16:13:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13107">
    <title>Re: function problem</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13107</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>David Sinclair</dc:creator>
    <dc:date>2008-12-01T15:16:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13106">
    <title>RE: drools 4.0 and enum in java 1.5</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13106</link>
    <description>
Hello,

I've these imports :

import com.pv.rules.beans.Message;
import com.pv.rules.beans.Message.Type.XML;

but it tell me :

Unable to create restriction '[QualifiedIndentifierRestr: ==
com.pv.rules.beans.Message.Type.XML ]' for field 'type' in the rule
'Contexte1' : [Rule name=Contexte1, agendaGroup=MAIN, salience=0,
no-loop=false]
Rule Compilation error : [Rule name=Contexte1, agendaGroup=MAIN,
salience=0, no-loop=false]
com/pv/rules/Rule_Contexte1_0.java (2:63) : The import
com.pv.rules.beans.Message.Type.XML cannot be resolved
com.pv.rules.beans.Message.Type.XML

Maybe, it's not possible to use enum in drl :-(

Thanks :-)


_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Thierry B</dc:creator>
    <dc:date>2008-12-01T15:02:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13105">
    <title>Re: expand rules with dsl</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13105</link>
    <description>
Ok, Thanks :-)

_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Thierry B</dc:creator>
    <dc:date>2008-12-01T11:25:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13104">
    <title>Re: StatefulSessionSnapshotter and full serializationmode</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13104</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Michal Bali</dc:creator>
    <dc:date>2008-12-01T10:30:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13103">
    <title>RE: drools 4.0 and enum in java 1.5</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13103</link>
    <description>Maybe you will have to import Message.Type.XML in the drl file and then use it.

-----Original Message-----
From: rules-users-bounces&lt; at &gt;lists.jboss.org [mailto:rules-users-bounces&lt; at &gt;lists.jboss.org] On Behalf Of Thierry B
Sent: Monday, December 01, 2008 3:32 PM
To: rules-users&lt; at &gt;lists.jboss.org
Subject: [rules-users] drools 4.0 and enum in java 1.5

Hello,

I'd like to use enum in java 1.5 with drools.

I try that :

A message class :
package com.pv.rules.beans;

public class Message {

        String payload;
        Type type;

        public enum Type {
           XML;
        }

        public Message(){
                this.type = Type.XML;
        }

        public Message(String payload){
                this.type = Type.XML;
                this.payload = payload;
        };

        public String getPayload(){
                return payload;
        }

        public void setPayload(String payload){
                this.payload = payload;
        }

        public Type getType(){
                return type;
        }
}

and in my drl :

rule "Contexte1"
        when
                &gt;msg : Message(type == "XML", payload : payload)
                xpathEquals "/Root/aaaa" "bbbb"
                xpathEquals "/Root/cccc" "dddd
        then
                Log : "Contexte 1 ************* : OK";
end

but I've this error :

Unable to resolve ObjectType 'Message' : [Rule name=Contexte1,
agendaGroup=MAIN, salience=0, no-loop=false]
Rule Compilation error : [Rule name=Contexte1, agendaGroup=MAIN,
salience=0, no-loop=false]

Do you have an idea?

Thanks :-)

_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Shyam, Pallav</dc:creator>
    <dc:date>2008-12-01T10:26:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13102">
    <title>Re: expand rules with dsl</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13102</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Michal Bali</dc:creator>
    <dc:date>2008-12-01T10:25:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13101">
    <title>drools 4.0 and enum in java 1.5</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13101</link>
    <description>Hello,

I'd like to use enum in java 1.5 with drools.

I try that :

A message class :
package com.pv.rules.beans;

public class Message {

String payload;
Type type;

public enum Type {
   XML;
}

public Message(){
this.type = Type.XML;
}

public Message(String payload){
this.type = Type.XML;
this.payload = payload;
};

public String getPayload(){
return payload;
}

public void setPayload(String payload){
this.payload = payload;
}

public Type getType(){
return type;
}
}

and in my drl :

rule "Contexte1"
when
&gt;msg : Message(type == "XML", payload : payload)
xpathEquals "/Root/aaaa" "bbbb"
xpathEquals "/Root/cccc" "dddd
then
Log : "Contexte 1 ************* : OK";
end

but I've this error :

Unable to resolve ObjectType 'Message' : [Rule name=Contexte1,
agendaGroup=MAIN, salience=0, no-loop=false]
Rule Compilation error : [Rule name=Contexte1, agendaGroup=MAIN,
salience=0, no-loop=false]

Do you have an idea?

Thanks :-)

_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Thierry B</dc:creator>
    <dc:date>2008-12-01T10:01:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13100">
    <title>expand rules with dsl</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13100</link>
    <description>Hello,

I've a question about drl and dsl with drools 4.0.

I've this rule :

rule "Contexte1"
when
   msg : Message(payload : payload)
   eval (DOMUtil.xpathEquals(payload, "/Root/aaaa", "bbb"))
   eval (DOMUtil.xpathEquals(payload, "/Root/cccc", "dddd"))
then
           System.out.println ("Contexte 1 ************* : OK");
end

I use a dsl, to make it work, so now my drl is like that :

rule "Contexte1"
when
&gt;msg : Message(payload : payload)
xpathEquals "/Root/aaaa" "bbb"
xpathEquals "/Root/cccc" "dddd"
then
Log : "Contexte 1 ************* : OK";
end

I was forced to make an "&gt;" at the line "msg : Message(payload : payload)"
otherwise, he tells me that he can't expand that line.

There is a way to :
- avoid to put the "&gt;" even if I have to add something else to the dsl ?
- avoid the line "msg : Message(payload : payload)" in my drl and simplify
my dsl so that xPathEquals "know" that the "payload" variable come from
any object Message in Working Memory ?

Thanks :-)

_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Thierry B</dc:creator>
    <dc:date>2008-12-01T08:56:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13099">
    <title>Re: Oring conditions</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13099</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Mark Proctor</dc:creator>
    <dc:date>2008-12-01T04:30:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13098">
    <title>recommend way about same when , different then</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13098</link>
    <description>Hi. I'm newbie to Drools.

I'm just wondering how I define the rules with my web application that has
several layers, web,business-logic,and data access.
one rule is used in the wab layer, and another one is used in the
business-logic layer.
Both rule's "when" are the same, but the "then"(action) is different.

It looks like code dupulication.
(I mean when the "when" changes, every rules that has same "when" has to be
changed, right?)

What's the recommended way in this situation?

thanks

Shige


_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

</description>
    <dc:creator>Shigeaki Wakizaka</dc:creator>
    <dc:date>2008-12-01T04:28:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13097">
    <title>Re: Oring conditions</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13097</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Waleed Zedan</dc:creator>
    <dc:date>2008-12-01T03:53:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13096">
    <title>Re: Oring conditions</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13096</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Edson Tirelli</dc:creator>
    <dc:date>2008-11-30T15:03:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.drools.user/13095">
    <title>Oring conditions</title>
    <link>http://permalink.gmane.org/gmane.comp.java.drools.user/13095</link>
    <description>_______________________________________________
rules-users mailing list
rules-users&lt; at &gt;lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
</description>
    <dc:creator>Waleed Zedan</dc:creator>
    <dc:date>2008-11-30T12:27:23</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.java.drools.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.java.drools.user</link>
  </textinput>
</rdf:RDF>
