I'm stuck with Drools 5 and need a little help. What I'd like to do is use a passed in DAO and assign a value from that to a local variable, like this...
rule "test rule 1"
when
$carDao : ICarDAO( )
$x : $carDao.getMap()
eval (
$x.contains("a") && $x.contains("b")
)
then
// do stuff
end
Drools 5 doesn't allow assignment of local variables though. I'd like to assign to a local variable so that I don't have to make the same call twice to the DAO.
So could someone point me in the correct direction please?
Thanks! Jeff Porter
rule "test rule 1"
when
$carDao : ICarDAO( )
$x: java.util.Map( ) from $carDao.getMap()
eval (
$x.contains("a") && $x.contains("b")
)
then
// do stuff
end
ta..dar!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With