Drools Quartz Calendars


Does anyone have a working example of the quartz calendar. I want some rules that only run in certain hours, but can’t seem to debug my code



Maybe this will help

Here's an interesting thought.

Can the timer be mixed with a source condition, so that the source is only checked during valid timer periods?

Something like this ???

package org.openremote.controller.protocol

global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;

rule "Sunrise"

  timer (cron: 0 00-30 7 ? * 2-6)


Event( source == "A_Sensor", value == "on")


  execute.command("bedroom_dim", 75);


This is how it works. The LHS is checked only on the cron condition. Mind however that the cron condition in your example triggers every minute in the given period so it will trigger the rule multiply times. This is not what you usually want, especially when you form your trigger something like "trigger it when the sensor is on but only in the period from to".