It depends a bit about the size of the organization, but if it is anything larger then small I would advise not to try to recreate a roster program inside of Mendix. Creating a roster is a very specialized task (like optimal route calculation etc.) that is done best by specialized programs.
But for the sake of argument if I would have to do it I would do for each hour a check which persons want to give a lesson in that period. Then do a check how many slots can be given in that period. Slots probably depend on how many classrooms are available at that time. Each time a slot is claimed by a tutor lower his score so that when you come in the situation that you have two slots and three teachers you can look at this score to assign slots. The one with the highest scores get the slot. You do have to check though that the ones that did not get the slot still can give that class in the future. Because let's say that a teacher is not working on Friday he should get the slot on Thursday instead of a teacher with a higher score if that teacher still has time on Friday.
As my example shows it can become quite complex. Let us know how you fare because from an intellectual standpoint I would like to know if a satisfying solution can be made.
Regards,
Ronald
Hi Paul,
Without seeing the sub-flows, it is hard to know what could be going wrong. Why is this microflow not succeeding for you? It looks like you retrieve a list of ‘sections’ and then for each section, you are checking if a block exists in the database. Should there be more than one block per section? How does a ‘schedule’ object relate to block? How do you know which teachers prefer which block? How do you know how many blocks there should be? It is hard to provide assistance on your specific example without more details.
I will say it is not a good idea to have an action to display a informational popup in a loop. That could mean a user is presented with many popups all at once displaying similar messages for each section. It is best to save the user feedback for the end with one consolidated message.
Related industry problem for inspiration
http://www.cse.chalmers.se/~dag/AirlineOptimization.pdf
https://smartech.gatech.edu/bitstream/handle/1853/43662/petersen_jon_d_201205_phd.pdf