[rules-users] Compiles in 4.07 not in 5.0 Snapshot (3/20)

Edson Tirelli tirelli at post.com
Tue Mar 24 09:06:15 EDT 2009


   Wolfgang,

   Yes, Drools rewrites insert() to drools.insert() before compiling. It
seems we have a problem in the function that does the rewrite.

   []s
   Edson

2009/3/24 Wolfgang Laun <wolfgang.laun at gmail.com>

> The RHS of a rule X winds up in some class Rule_X_0. Calls like insert(),
> retract(), etc. are, by definition, method calls of WorlingMemoryEntryPoint,
> and the compiler ought to prefix them with the global reference to that
> object, i.e., "drools". This fails within if statements, both branches.
>
> If you write, inside (or outside) if
>    drools.insert(...);
>    drools.retract(...)
> all is well.
>
> -W
>
>
> 2009/3/23 Edson Tirelli <tirelli at post.com>
>
>
>>    This is odd, since this part of the code didn't changed much from
>> drools 4 to 5 (assuming you are using java dialect for your consequence).
>> Can you open a JIRA with your test case plz?
>>
>>    []s
>>    Edson
>>
>> 2009/3/23 Jared Davis <sunray at davisprogramming.com>
>>
>> Hi,
>>>
>>> This rule (not the best style) compiles fine in 4.07. It gives this error
>>> message using 5.0 Snapshot. I changed some of the text to be generic so I
>>> could
>>> post the code.
>>>
>>> Rule Compilation error : [Rule
>>> name='A.B.inlet.mxb.first.link.20090216.01']
>>>
>>>  com/zzzzzz/yyy/awl/Rule_A_B_inlet_mxb_first_link_20090216_01_0.java
>>> (11:5517) : The method insert(RuleLink) is undefined for the type
>>> Rule_A_B_inlet_mxb_first_link_20090216_01_0
>>>
>>>
>>> Here is the rule: (I had to change all the > to . to get gmane to accept
>>> the
>>> email as a non top post)
>>>
>>> rule "A.B.inlet.mxb.first.link.20090216.01"
>>> agenda-group "A.B"
>>> when
>>>
>>> .     comp :     XComponentRule( path == "~unit~mxb")
>>> then
>>> .     Point3d l = new Point3d();
>>> .     comp.getBounds().getLower(l);
>>>
>>> .     if (l.x < 1)  {
>>> .        insert( new RuleLink("FIRST.INLET" , comp, comp) );
>>> .     } else {
>>> .        insert( new RuleLink("FIRST.INLET.NOT" , comp, comp) );
>>> .     }
>>> .
>>> end
>>>
>>> If I change the rule to
>>>
>>> rule "A.B.inlet.mxb.first.link.20090216.01"
>>> agenda-group "A.B"
>>> when
>>>
>>> .     comp :     XComponentRule( path == "~unit~mxb")
>>> then
>>> .     Point3d l = new Point3d();
>>> .     comp.getBounds().getLower(l);
>>> .     String name = "FIRST.INLET";
>>> .     if (l.x < 1)  {
>>> .       // nothing
>>> .     } else {
>>> .       name = "FIRST.INLET.NOT";
>>> .     }
>>> .     insert( new RuleLink(name , comp, comp) );
>>> .
>>> end
>>>
>>> it compiles w/o a problem.
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>
>>
>>
>> --
>>  Edson Tirelli
>>  JBoss Drools Core Development
>>  JBoss, a division of Red Hat @ www.jboss.com
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090324/b6c583b4/attachment.html 


More information about the rules-users mailing list