[jboss-jira] [JBoss JIRA] Created: (JBRULES-1089) Getting "could not access property ('=')" for a valid rule.

Arsalan Zaidi (JIRA) jira-events at lists.jboss.org
Thu Aug 16 02:59:01 EDT 2007


Getting "could not access property ('=')" for a valid rule.
-----------------------------------------------------------

                 Key: JBRULES-1089
                 URL: http://jira.jboss.com/jira/browse/JBRULES-1089
             Project: JBoss Rules
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Drl Parser/Builder
    Affects Versions:  4.0.0.GA
         Environment: WinXP, Java 1.6.0 (Sun), running within Eclipse 3.2.2
            Reporter: Arsalan Zaidi
         Assigned To: Mark Proctor


From: rules-users-bounces at lists.jboss.org on behalf of Edson Tirelli [tirelli at post.com]
Sent: 13 August 2007 22:16
To: Rules Users List
Subject: Re: [rules-users] could not access property ('=')

Attachments: ATT426765.txt


   This looks like an MVEL issue, since your expression is being converted into an MVEL predicate. May I ask you please to open a JIRA for that bug?

   Meanwhile, a workaround that shall work for you and may give you improved perf is to split your pattern into 2 patterns using the from keyword: 





when

           $dto : DTO( )

           W250_4_1( value in ("0" ,"1" ,"6" ,"7" ,"A" ,"C" ,"D" ,"G" ,"L" ,"M" ,"P" ,"Q" ,"S" ,"V" ,"Z" ) ) from $dto.w250_4_1


then



   Thanks, and hope it helps.

   Edson



2007/8/13, Arsalan S. Zaidi < arsalan.zaidi at capgemini.com>:
  Hi.



  I've currently evaluating Drools 4.0 for a project of ours and I'm running into some problems.



  I have a rule which looks like this:



  rule "W250.42 Editable"

        when

              DTO(w250_4_1.value in ("0" ,"1" ,"6" ,"7" ,"A" ,"C" ,"D" ,"G" ,"L" ,"M" ,"P" ,"Q" ,"S" ,"V" ,"Z" ) )

        then

              System.out.println ("0" );

              Action action = createAction("W250.42" , false , true );

              retList.add(action); 

  end 





  both DTO and w250_4_1 are extremely simple beans. w250_4_1 just has 1 property 'value' which is a String and DTO has one property w250_4_1 which is the bean w250_4_1 .



  Now when I put "0" into w250_4_1 then everything works fine. The rule is true and the 'then' portion is executed. However, if I set w250_4_1 to "6" (which is also present in the in (...)) then I get the following error.



  org.drools.RuntimeDroolsException : Exception executing predicate org.drools.base.mvel.MVELPredicateExpression at 118fa47

        at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197 )

        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:122 )

        at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:317 )

        at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:168 )

        at org.drools.reteoo.Rete.assertObject(Rete.java:168 )

        at org.drools.reteoo.ReteooRuleBase.assertObject( ReteooRuleBase.java:190) 

        at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70 )

        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:848 )

        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:822 )

        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:623 )

        at com.sample.DroolsTest.main( DroolsTest.java:34)

  Caused by: org.mvel.PropertyAccessException: failed to access property: <<==>> in: class com.sample.DTOShadowProxy

        at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:137 )

        at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:96 )

        at org.mvel.ASTNode.getReducedValueAccelerated(ASTNode.java:194 )

        at org.mvel.ast.Or.getReducedValueAccelerated(Or.java:18 )

        at org.mvel.MVELRuntime.execute( MVELRuntime.java:87)

        at org.mvel.CompiledExpression.getValue( CompiledExpression.java:98) 

        at org.mvel.MVEL.executeExpression( MVEL.java:202)

        at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:36 )

        at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191 )

        ... 10 more

  Caused by: org.mvel.PropertyAccessException: could not access property ('=') 

        at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:252 )

        at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:106 )

        ... 18 more



  If I keep w250_4_1 as "0", but move "0" in the rule to any other place place in the in() list (e.g. in ("1","0",...), then I get a similar error.



  I get similar errors when trying to use 'not in' in the same circumstance, except that then the property is ('!')



  What seems to be the issue?



  Thanks in advance!



  Regards,



  --Arsalan

        This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. 

       

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





-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list