Logic behind Microflow

Hi everyone, Trust you’re all doing good. Many thanks for the great ideas that are usually shared here. My team is currently working on a project and we are stuck on the micro flows that is supposed to produce the logic for the app to be functional. the app we are working on is to generate a schedule for an academic organization. We have developed the app to a very large extent and are left with figuring out the algorithm behind Once the “general schedule” button is clicked, the app is supposed to output the names of teachers, their preferred time blocks (Mon 8am -Fri 5pm) and the subjects (these have different sections) they teach. The team is stuck on the construction of the logic that will create the automated schedule. please let me know if you need more clarifications. I have attached the screenshots for your perusal. Please this isn’t the final version but I’m hoping this can spark some thoughts around this. 
3 answers

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.



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