<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey, <div><br></div><div>I use a lot of quartz calendars in my rules like this:</div><div><br></div><div><div style="margin: 0px; font-size: 12px; font-family: Monaco; color: rgb(0, 143, 0); "><span style="color: #a91500">rule</span><span style="color: #000000"> </span>"my rule"</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; color: rgb(146, 144, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>calendars </span><span style="color: #008f00">"myCalendar"</span><span style="color: #000000"> </span></div><div style="margin: 0px; font-size: 12px; font-family: Monaco; color: rgb(169, 21, 0); ">when</div></div><div style="margin: 0px; font-size: 12px; font-family: Monaco; color: rgb(169, 21, 0); "><br></div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; ">But defining them in java is quite verbose. Also I often use the same calendar for only one rule. I believe the calendar is part of the logic and therefore don't like to initialize it elsewhere but with the logic code in the rule.</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; "><br></div><div style="font-family: Helvetica; font-size: medium; "><div style="color: rgb(0, 0, 0); margin: 0px; font-size: 12px; font-family: Monaco; ">DailyCalendar myCalendar = <span style="color: #931a68">new</span> DailyCalendar( 7, 0, 0, 0, 8, 0, 0, 0 );</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><div style="color: rgb(0, 0, 0); margin: 0px; ">myCalendar.setInvertTimeRange( <span style="color: #931a68">true</span> );</div><div style="margin: 0px; "><div style="color: rgb(0, 0, 0); margin: 0px; "><span style="color: #0326cc">ksession</span>.getCalendars().set( <span style="color: #3933ff">"myCalendar"</span>, QuartzHelper.quartzCalendarAdapter( myCalendar ) );</div><div style="color: rgb(0, 0, 0); margin: 0px; "><br></div><div style="margin: 0px; "><div style="color: rgb(0, 0, 0); font-size: medium; font-family: Helvetica; ">I would rather define calendars directly in the rule files or even exactly where I use them, e.g.</div><div style="color: rgb(0, 0, 0); font-size: medium; font-family: Helvetica; "><br></div><div style="font-size: medium; font-family: Helvetica; "><div style="color: rgb(0, 143, 0); font-size: 12px; margin: 0px; font-family: Monaco; "><span style="color: rgb(169, 21, 0); ">rule</span><span style="color: rgb(0, 0, 0); "> </span>"my super rule"</div><div style="font-size: 12px; margin: 0px; font-family: Monaco; "><span style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space: pre; ">        </span>calendars</span><font color="#008f00"> DailyCalendar(</font><span style="color: rgb(0, 0, 0); "> </span> 7, 0, 0, 0, 8, 0, 0, 0, true );</div><div style="color: rgb(169, 21, 0); font-size: 12px; margin: 0px; font-family: Monaco; ">when</div><div style="color: rgb(169, 21, 0); font-size: 12px; margin: 0px; font-family: Monaco; "><br></div><div style="color: rgb(169, 21, 0); font-size: 12px; margin: 0px; font-family: Monaco; "><div style="color: rgb(0, 0, 0); font-size: medium; font-family: Helvetica; ">or defining them in the rule file like this: (example)</div><div style="color: rgb(0, 0, 0); font-size: medium; font-family: Helvetica; "><br></div><div style="color: rgb(0, 0, 0); font-size: medium; font-family: Helvetica; "><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><span style="color: #a91500">declare</span> "myCalendar"</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>@role(calendar)</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>@type( daily )</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>@from (7,0,0)</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>@until (8, 0, 0)</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>@invert(true)</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; color: rgb(169, 21, 0); ">end</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; color: rgb(169, 21, 0); "><br></div><div style="margin: 0px; font-size: 12px; font-family: Monaco; color: rgb(169, 21, 0); "><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; ">and the use them as ever. </div><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; "><br></div><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; ">I couldnt find anything like this in the documentation, but would not be surprised if it is actually already possible somehow.</div><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; "> </div><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; ">If not I would like to suggest this as a new feature ;) (I think I'd prefer the second example with declare)</div><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; "><br></div><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; ">- Alex</div><div style="font-size: medium; color: rgb(0, 0, 0); font-family: Helvetica; "><br></div></div></div></div></div></div></div></div></div></div></body></html>