[
https://jira.jboss.org/jira/browse/JBRULES-2244?page=com.atlassian.jira.p...
]
Edson Tirelli updated JBRULES-2244:
-----------------------------------
Description:
The following DRL:
===================================================
package org.drools.examples.broker
import org.drools.examples.broker.model.*;
dialect "mvel"
declare Statistics
symbol : String @key()
average : double
end
rule "Setup statistics"
when
$c : Company( $s : symbol )
not( Statistics( symbol == $s ) )
then
Statistics s = new Statistics();
s.symbol = $s;
insert( s );
end
===================================================
Generates the error:
-----------------------------
BuildError: Unable to build expression for 'consequence': Failed to compile: 1
compilation error(s):
- (1,10) unqualified type in strict mode for: Statistics ' Statistics s = new
Statistics();
s.symbol = $s;
insert( s );
' broker.drl drools-examples-fusion/src/main/rules line 42 Drools Error
-----------------------------
But if we change the import to:
===================================================
import org.drools.examples.broker.model.Company
import org.drools.examples.broker.model.StockTick
import org.drools.examples.broker.model.SuddenDropEvent
===================================================
Everything works just fine.
was:
The following DRL:
===================================================
package org.drools.examples.broker
import org.drools.examples.broker.model.*;
declare Statistics
symbol : String @key()
average : double
end
rule "Setup statistics"
when
$c : Company( $s : symbol )
not( Statistics( symbol == $s ) )
then
Statistics s = new Statistics();
s.symbol = $s;
insert( s );
end
===================================================
Generates the error:
-----------------------------
BuildError: Unable to build expression for 'consequence': Failed to compile: 1
compilation error(s):
- (1,10) unqualified type in strict mode for: Statistics ' Statistics s = new
Statistics();
s.symbol = $s;
insert( s );
' broker.drl drools-examples-fusion/src/main/rules line 42 Drools Error
-----------------------------
But if we change the import to:
===================================================
import org.drools.examples.broker.model.Company
import org.drools.examples.broker.model.StockTick
import org.drools.examples.broker.model.SuddenDropEvent
===================================================
Everything works just fine.
MVEL raising errors for declared types when there is a package import
(import x.y.x.*)
--------------------------------------------------------------------------------------
Key: JBRULES-2244
URL:
https://jira.jboss.org/jira/browse/JBRULES-2244
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler, drools-core
Affects Versions: 5.0.0.FINAL, 5.0.1.FINAL
Reporter: Edson Tirelli
Assignee: Edson Tirelli
Fix For: 5.1.0.M1
The following DRL:
===================================================
package org.drools.examples.broker
import org.drools.examples.broker.model.*;
dialect "mvel"
declare Statistics
symbol : String @key()
average : double
end
rule "Setup statistics"
when
$c : Company( $s : symbol )
not( Statistics( symbol == $s ) )
then
Statistics s = new Statistics();
s.symbol = $s;
insert( s );
end
===================================================
Generates the error:
-----------------------------
BuildError: Unable to build expression for 'consequence': Failed to compile: 1
compilation error(s):
- (1,10) unqualified type in strict mode for: Statistics ' Statistics s = new
Statistics();
s.symbol = $s;
insert( s );
' broker.drl drools-examples-fusion/src/main/rules line 42 Drools Error
-----------------------------
But if we change the import to:
===================================================
import org.drools.examples.broker.model.Company
import org.drools.examples.broker.model.StockTick
import org.drools.examples.broker.model.SuddenDropEvent
===================================================
Everything works just fine.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira