So the cars with their shifts would be hard facts. Or, as I&#39;d do it: there&#39;s cars, and shifts, and assignments of cars to shifts.<br><br>The definition of a shift is all that&#39;s necessary to generate the roster for any car that&#39;s defined to run during this shift, and so a shift would be a set of definitions made up from day of week, start time, end time, holiday flag, etc. Therefore, I think you&#39;ll need a way of defining these descriptions in a convenient way - but this is not a rule, it&#39;s the definition for an interval depending on calendar and clock values. (Does &quot;crontab&quot; mean anything to you?)<br>
<br>Now, given these sets of shift definitions and the cards and the association between these, you can generate, for any given month, the actual times for each car, i.e., what the drivers can sign up for. With all the days of a month as facts (with the properties that are used in the shift definitions) you can write a set of rules that match the days with shift definitions and cars, and each match will then create a schedule entry for sign up. You don&#39;t need a human readable notation for this (presumably: small) set of rules; these are technical and not to be messed with by end users.<br>
<br>HTH<br>Wolfgang<br><br><br><div class="gmail_quote">2012/1/16 Sverker Abrahamsson <span dir="ltr">&lt;<a href="mailto:sverker@abrahamsson.com">sverker@abrahamsson.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="SV"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi Wolfgang<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Well, to be more specific the resources are taxi cars. Each taxi has their pre-defined shifts when they should be operating, then the drivers can sign up for which shifts they want to work.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">What I want to accomplish is to have a set of rules or formulas in a human readable syntax which at beginning of each month generate these shifts. The input to the rule/formula could e.g. be to iterate over the dates of the month something like this:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Rule for shift: Every Monday 8-17<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Input: Iterate over the dates of February 2012<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Output: Shift (2012-02-06 8-17), Shift (2012-02-13 8-17), Shift (2012-02-20 8-17), Shift (2012-02-27 8-17)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"> Would this be suitable to implement with drools or do you have a suggestion for a more appropriate tool?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Best regards<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Sverker<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Wolfgang Laun<br>
<b>Sent:</b> den 14 januari 2012 9:45<br><b>To:</b> Rules Users List<br><b>Subject:</b> Re: [rules-users] Rules for generating calendar events<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">
There is one sentence that lets me ask whether you understand the<u></u><u></u></p><div><p class="MsoNormal">workings of a rule based system: &quot;...the rules that generate the events...&quot;.<u></u><u></u></p></div><div>
<p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The essential idea of a RBS is the <i>selection</i> of data (&quot;facts&quot;) based on its<u></u><u></u></p></div><div><p class="MsoNormal">attributes by conditions being evaluated over combinations of <u></u><u></u></p>
</div><div><p class="MsoNormal">data items. Then, as a secondary activity, the RBS may be instructed<u></u><u></u></p></div><div><p class="MsoNormal">to create additional facts.<u></u><u></u></p></div><div><p class="MsoNormal">
<u></u> <u></u></p></div><div><p class="MsoNormal">Generating facts out of Nothing is not the forte of a RBS; I don&#39;t see how<u></u><u></u></p></div><div><p class="MsoNormal">you could write rules that generate &quot;events&quot; by deriving them out of - what?<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Perhaps you could provide more background?<br><br>-W<u></u><u></u></p><div><p class="MsoNormal">On 14 January 2012 02:47, sverker &lt;<a href="mailto:sverker@abrahamsson.com" target="_blank">sverker@abrahamsson.com</a>&gt; wrote:<u></u><u></u></p>
<p class="MsoNormal">Hi<br>I have an application where I want to generate calendar events. Each event<br>will have an attached resource and people will be able to book themselves to<br>this event. The events are re-occuring in that they are on fixed time each<br>
day/weekday etc, like &quot;every friday 07:00 -12:00 unless holiday&quot; or<br>something like that. The events shall be batch generated at beginning of<br>each month and put into a database. I want the rules that generate the<br>
events to have some kind of DSL to be easily readable also for<br>non-technishians.<br><br>My question, would drools be a suitable tool for this task? I&#39;ve been trying<br>to find examples on the above but couldn&#39;t find any.<span class="HOEnZb"><font color="#888888"><br>
<span style="color:#888888"><br><span>/Sverker</span><br><br><span>--</span><br><span>View this message in context: <a href="http://drools.46999.n3.nabble.com/Rules-for-generating-calendar-events-tp3658179p3658179.html" target="_blank">http://drools.46999.n3.nabble.com/Rules-for-generating-calendar-events-tp3658179p3658179.html</a></span><br>
<span>Sent from the Drools: User forum mailing list archive at Nabble.com.</span><br><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></span><br>
<span><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></span></span><u></u><u></u></font></span></p></div><p class="MsoNormal"><u></u> <u></u></p>
</div></div></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>