Hey there,
as far as I know, there are two ways of using item values in rules: value declaration and using .state directly (see example below).
rule "example"
when
Item x changed
then
val y = item_y.state [as x]
if (y == 1) {
<snip>
if (item_y.state == 1) {
<snip>
Value declaration might be faster when a value is used multiple times, but the differences were not really measurable on my hardware (Intel NUC with i3-Processor).
Are there any pros and cons about which option to choose? Are there some preferred situations for either ones?
Kind regards!