<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:10pt">Hi Cedric,<br><br>Thanks for your comment.<br>How should I model this schedule object? I mean, at which point do I put a 'assignment' in the list?<br>Should I do this within a rule?<br>Could you elaborate a bit on this solution?<br><br>Thanks!<br><br>Michiel<br><div><span><br></span></div><div>&nbsp;</div><div>-----------------<br>http://www.codessentials.com - Your essential software, for free!<br>Follow us at http://twitter.com/#!/Codessentials<br></div>  <div style="font-family: tahoma, new york, times, serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Cedric Hurst &lt;cedric@spantree.net&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Michiel Vermandel
 &lt;mvermand@yahoo.com&gt;; Rules Users List &lt;rules-users@lists.jboss.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, December 4, 2012 11:22 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] How to ensure that a person does not execute the same task twice in a row?<br> </font> </div> <br>
<div id="yiv608577449"><div><div>I believe you'll probably to create a schedule object that keeps track of all assignments. &nbsp;From there , we can create a rule to assign a negative constraint penalty to any schedules with two adjacent assignments for the same person with the same task. &nbsp;<br><br>Sent from my iPhone</div><div><br>On Dec 4, 2012, at 10:40 AM, Michiel Vermandel &lt;<a rel="nofollow" ymailto="mailto:mvermand@yahoo.com" target="_blank" href="mailto:mvermand@yahoo.com">mvermand@yahoo.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div style="color:#000;background-color:#fff;font-family:tahoma, new york, times, serif;font-size:10pt;"><div><span>Hi,</span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><br><span></span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times,
 serif;background-color:transparent;font-style:normal;"><span>In my usecase I need to plan tasks (PlanningEntity).</span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><span>I have two kinds of tasks (for example CleaningTask and InspectionTask (inspect that cleaning was OK)).</span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;">Each
 task<span> needs to be assigned to a person and a period.</span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><span>Person and period both are PlanningVariables.</span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><span><br></span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><span>I need to ensure that a person does not execute an </span><span><span>InspectionTask</span> twice in a row.</span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><span>How can I find out what the previous task is that is assigned to a
 person?</span></div><div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:tahoma, new york, times, serif;background-color:transparent;font-style:normal;"><span>It is not guaranteed that the person had a task in the previous period (period-1).</span></div><div>&nbsp;<br>Thanks,<br><br>Michiel<br></div><div>-----------------<br>http://www.codessentials.com - Your essential software, for free!<br>Follow us at http://twitter.com/#!/Codessentials</div></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></span><br><span><a rel="nofollow" target="_blank"
 href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote></div></div><br><br> </div> </div>  </div></body></html>