<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><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 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><a href="http://www.codessentials.com">http://www.codessentials.com</a> - Your essential software, for free!<br>Follow us at <a href="http://twitter.com/#!/Codessentials">http://twitter.com/#!/Codessentials</a></div></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote></body></html>