Using val/var in trigger line

Im trying to do something like this:

val FIBARO_212_ROLLERBLIND_SCENE_DOUBLECLICK = 14
val FIBARO_212_ROLLERBLIND_SCENE_TRIPLECLICK = 15

rule Lights_LivingRoom_All_On
when
    Item zwave_device_node11_scene_number received update FIBARO_212_ROLLERBLIND_SCENE_DOUBLECLICK or
    Item Scene_LivingRoom received update 1
then
    Light_FirstFloor.sendCommand(100)
end

But it doesn’t work. If I substitute the FIBARO_212_ROLLERBLIND_SCENE_DOUBLECLICK with 14 in the script body, then it does work. Can vals and vars only be used in the script body?

My main aim is to define the magic scene numbers once, and be able to reference them by name afterwards, and not by number anymore.

Btw, I’ve tried the explicit Number type as well in the val declaration.

val	Integer	FIBARO_212_ROLLERBLIND_SCENE_DOUBLECLICK = 14

or…

rule Lights_LivingRoom_All_On
when
    Item zwave_device_node11_scene_number received update
then
	if (zwave_device_node11_scene_number.state == 14) {
		logInfo("Scene_Mng", "Scene 14")
		Light_FirstFloor.sendCommand(50)
	}
	if (zwave_device_node11_scene_number.state == 15) {
		logInfo("Scene_Mng", "Scene 15")
		Light_FirstFloor.sendCommand(100)
	}
end

Your first option doesn’t work. FTR, I tried Number, Integer and int now.