[rules-users] strict-mode and nested object property access in drools 5.4.0.Final - can i cast?

radai rosenblatt radai.rosenblatt at gmail.com
Thu May 24 09:44:45 EDT 2012


i tried this:

rule "Naive Payload Access"
    @typesafe( false )
when
   $container : ClassWithPayload(key == "someKey", (payload != null &&
((PayloadClass)payload.getSomeProp()) == "someValue"))
then
   System.err.println("boom");
end

which results in 
java.lang.AssertionError: Unable to Analyse Expression
((PayloadClass)payload.getSomeProp()):
[Error: unable to resolve method using strict-mode:
java.lang.Object.getSomeProp()]
[Near : {... ((PayloadClass)payload.getSomeProp()) ....}]

and:

rule "Naive Payload Access"
    @typesafe( false )
when
   $container : ClassWithPayload(key == "someKey", (payload != null &&
payload.getSomeProp() == "someValue"))
then
   System.err.println("boom");
end

which, similarly, leads to:
java.lang.AssertionError: Unable to Analyse Expression
payload.getSomeProp():
[Error: unable to resolve method using strict-mode:
java.lang.Object.getSomeProp()]
[Near : {... payload.getSomeProp() ....}]

was that what you meant?

--
View this message in context: http://drools.46999.n3.nabble.com/strict-mode-and-nested-object-property-access-in-drools-5-4-0-Final-can-i-cast-tp4013373p4013569.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list