[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1191) compilation error when consequence has no space between rule mappings

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Thu Sep 13 15:49:11 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBRULES-1191?page=comments#action_12376741 ] 
            
Edson Tirelli commented on JBRULES-1191:
----------------------------------------

I added a test to KnowledgeHelperFixer in MVEL tests:

    public void testRetract() {
        final String raw = "System.out.println(\"some text\");retract(object);";
        assertEqualsIgnoreWhitespace( "System.out.println(\"some text\");drools.retract(object);",
                                      KnowledgeHelperFixerTest.fixer.fix( raw ) );
    }
    
   Note that adding a space between the ';' and the "retract" makes the macro work correctly, so a space-sensitive bug.

> compilation error when consequence has no space between rule mappings
> ---------------------------------------------------------------------
>
>                 Key: JBRULES-1191
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1191
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.0.1
>         Environment: Windows XP, Eclipse Europa
>            Reporter: Christopher Mathrusse
>         Assigned To: Mark Proctor
>
> I am using a DRL with a DSL. My DRL has a rule as follows:
> rule "Maximum Order Amount Exceeded"
> salience 9800
> 	when
> 	   	There is an Order
> 	   	- with an amount that exceeds 100000	
> 	then 
> 		Manually release the Order	
> end
> The DSL for this rule is as follows:
> [condition][]There is an Order to release=theOrder : Order ( releasable == true)
> [condition][]- with an amount that exceeds {number}=amount >= {number}
> [consequence][]Manually release the Order=setManualRelease(drools.getRule().getName());retract(theOrder); 
> But this produces a compilation error as follows:
> The method retract(Order) is undefined for the type Rule_Maximum_Order_Amount_Exceeded_0         
> Thanks to the help of Edson we discovered that an embedded space is needed between the ; and the retract statement. 

-- 
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