[rules-users] how to get first and last element of list of facts?

Michiel Vermandel mvermand at yahoo.com
Tue Dec 4 10:58:45 EST 2012


Hi,

I need to plan some tasks within a nr of timeslots.
Until now a task was always done within the period of one timeslot and I could validate my rules since a task has a planning variablegetTimeSlot/ setTimeSlot.
Now requirements have changed and a task can take more than one timeslot to complete.
What is the best way to validate that the task is not started in a timeslot that would end the task after the last timeslot?

- Timeslots are always equally long (for example a week).
- All timeslots in the list of timeslots are sequential (no gaps). 
So if I have a list of timeslots W18, W19, W20, W21 and I have a task taking 3 TimeSlots to complete, it should start in W18 or W19.

Should I create a single planningRange fact, holding the first and last slot?


Any directions would be appreciated.

Regards,

Michiel Vermandel

 
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20121204/b8c0ca43/attachment.html 


More information about the rules-users mailing list