@JRuleWhen(item = _MyTestSwitch.ITEM, trigger = _MyTestSwitch.TRIGGER_CHANGED_TO_ON)
->
@JRuleWhenItemChange(item = _MyTestSwitch.ITEM, to = JRuleSwitchItem.ON)
@JRuleWhen(item = _MyTestSwitch2.ITEM, trigger = _MyTestSwitch2.TRIGGER_CHANGED_FROM_OFF_TO_ON)
->
@JRuleWhenItemChange(item = _MyTestSwitch2.ITEM, from = JRuleSwitchItem.OFF, to = JRuleSwitchItem.ON)
@JRuleWhen(item = __MyTestSwitch2.ITEM, trigger = __MyTestSwitch2.TRIGGER_RECEIVED_COMMAND)
->
@JRuleWhenItemReceivedCommand(item = _MyTestSwitch2.ITEM)
@JRuleWhen(item = _MyTemperatureSensor.ITEM, trigger = _MyTemperatureSensor.TRIGGER_RECEIVED_UPDATE, lte = 20)
->
@JRuleWhenItemChange(item = _MyTemperatureSensor.ITEM, condition = @JRuleCondition(lte = 20))
@JRuleWhen(channel = "binding:thing:buttonevent")
->
@JRuleWhenChannelTrigger(channel = "mqtt:topic:mqtt:generic:numberTrigger")
@JRuleWhen(cron = "4 * * * * *")
->
@JRuleWhenCronTrigger(cron = "*/5 * * * * *")
@JRuleWhen(hours = 3)
->
@JRuleWhenTimeTrigger(hours=3)
@JRuleWhen(thing = "*", trigger = JRuleThingStatusTrigger.TRIGGER_CHANGED, from = "ONLINE")
->
@JRuleWhenThingTrigger(from = JRuleThingStatus.ONLINE)
@JRulePrecondition(item=_MyTestDisturbanceSwitch.ITEM, eq = "ON")
->
@JRulePrecondition(item = _MyTestDisturbanceSwitch.ITEM, condition = @JRuleCondition(eq = "ON"))
JRuleEvent is now abstract with 4 concrete implementations
- JRuleItemEvent
- JRuleChannelEvent
- JRuleTimerEvent
- JRuleThingEvent Depending on the trigger that was fired, the respective event will be thrown. You can use the abstract JRuleEvent as method parameter or a concrete one, but take care to be sure that just this event can be thrown. Otherwise an exception will occur.
Trigger for an Item will inject an JRuleItemEvent as method parameter For the method you can use JRuleEvent (has to be cast to get the interesting information) or JRuleItemEvent
- Trigger for a Thing and use JRuleItemEvent as method parameter -> Exception
- Trigger for an Item and a Cron and use JRuleItemEvent -> Exception when the method will be trigger for cron