Details
-
Bug
-
Resolution: Done
-
Major
-
5.3.1.Final, 5.3.2.Final, 5.4.0.Final
-
None
-
Workaround Exists
-
Description
case class Address(street:String, town:String, country:String)
case class Home(someone:Someone, address:Option[Address])
rule "Who live at London"
when
$someone:Someone($name:name)
Home(someone == $someone, address.isDefined, address.get.town == "London")
then
insert(new InformationRequest($someone, $name+" lives in London"))
end
address.get is seen as a java.lang.Object, not an "Address". The reported error is :
$ sbt run
[info] Loading project definition from /home/dcr/dev-new/scala-drools-dummy-project/project
[info] Set current project to ScalaDroolsDummyProject (in build file:/home/dcr/dev-new/scala-drools-dummy-project/)
[info] Running dummy.Dummy
Unable to Analyse Expression address.get.town:
[Error: unable to resolve method using strict-mode: java.lang.Object.town()]
[Near :
]
^
[Line: 61, Column: 49] : [Rule name='Who live at London']
Although I've set mvel strict to false :
System.setProperty("drools.dialect.mvel.strict", "false")