Hi,
I’m reading through DROOLS manual and can’t
understand the difference / explanations regarding predicate expression (Figure
3.17) and return value expression (Figure 3.18). The manual gives two examples
of the same thing done two different ways:
Predicate expression:
Person( girlAge : age, sex = "F" )
Person( boyAge : age -> ( girlAge.intValue() == boyAge.intValue() + 2 ), sex = 'M' )
Return value expression:
Person( girlAge : age, sex == "F" )
Person( age == ( new Integer(girlAge.intValue() + 2) ), sex == 'M' )
While the ‘return value’ expression is more or
less clear, I can’t understand the semantics of ‘predicate’ (‘->’)
operator. Can anyone decode this? What’s the difference between the two?
When each of the ways should be used and why?
Thanks!
Vlad