Bug 777782 (SOA-298) - org.mvel.CompileException: variable already defined within scope
Summary: org.mvel.CompileException: variable already defined within scope
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-298
Product: JBoss Enterprise SOA Platform 4
Classification: JBoss
Component: JBoss Rules
Version: 4.2 Beta 1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.2 Beta 2
Assignee: Fernando Meyer
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-09 17:14 UTC by Fernando Meyer
Modified: 2008-01-10 16:28 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-10 16:28:47 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-298 0 None None None Never

Description Fernando Meyer 2008-01-09 17:14:36 UTC
project_key: SOA

Reported by Alexander Bagerman.

The following rule and code snippet raises the problem:

rule "rule"
    dialect "mvel"
    when
        $p : Person( $likes : likes )
    then
        Cheese c = new Cheese( $likes );
        System.out.println( $p + " -> " + c );
        insert( c );
end

// snippet
            Person bob = new Person( "Bob", "stilton" );
            Person mark = new Person( "Mark", "brie" );
            workingMemory.insert( bob );
            workingMemory.insert( mark );
            workingMemory.fireAllRules();

The exception is:

Caused by: org.mvel.CompileException: variable already defined within scope: class com.sample.Cheese c
at org.drools.base.mvel.DroolsMVELFactory.createVariable(DroolsMVELFactory.java:218)
at org.mvel.ast.TypedVarNode.getReducedValueAccelerated(TypedVarNode.java:43)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:108)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:47)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)

Comment 1 Fernando Meyer 2008-01-09 17:14:57 UTC
Link: Added: This issue is related to JBRULES-1397


Comment 2 Fernando Meyer 2008-01-10 16:28:47 UTC
Patch applied 


Note You need to log in before you can comment on or make changes to this bug.