Home Dynamics Projects Dynamics Blogs Microsoft Watch Stem cells

 

 

Job Scheduling code.

Well, hello there. Long time no see. 

BEFORE ANYTHING ELSE..I WILL REMOVING ALL XPO FILES FROM THIS SITE VERY SOON WHAT IT MEANS IS THAT BASICALLY MOST OF THE PROJECTS ARE GOING TO DISAPPEAR FROM HERE. IF YOU WISH THEN PLEASE SAVE THEM ON YOUR HARD-DISK.

I have been busy for the last couple of months, Changed continents for a couple of times....A long holiday...unexpected surgery.....lot of things happened in the meanwhile. Oh yes also a change in my job profile.

Well, now that I have settled down in the new job and the new country and the new continent, it is time to publish some more blogs on this site.

Recently I had to dig into the job-scheduling code for some reason and was running around in circles while debugging the code. This is the part of the code that seems to go into a never ending loop calling the same methods again and again. Now, if you have ever put a debug on wrkCtrScheduleJobs_Detail you would exactly know what I am saying. 

So I thought why not write some notes explaining the most confusing part of the code (at least most confusing for me*s*)

Word of caution..this work is not for the beginners. It is expected that in the past you have spent some frustrating hours debugging this code.

You will have to keep the linked visio diagram open in another window while going through the explanation.

This is a very simplified diagram for a single line route that has only run time (i.e. no setup time, transport time etc etc). It is also assumed that number of work centers is equal to one.

During coverage scheduling "runMaster" may get called twice. Let us take an example. A production order delivery date is 13th of August and today is 1st of June. The scheduling engine will first try to search backwards from 13th August to 1st of June. This is the first call to “RunMaster” and is called backward scheduling. If no capacity is available during this period then an attempt is made to search for capacity forward from 1st June forwards and is called forward scheduling.

 Let us now jump to the bottom level calls and understand "ScheduleJob" and "SlotConflict.check()". "ScheduleJob" fits a job on a workCenter on the time line. For e.g. if a job needs 8 hours then "ScheduleJob" will assign timing 8 AM to 5 PM to a work center. "SlotConflict.check()" will check if any other job has already reserved this time on the same day. If yes, then a further call is made to "ScheduleJob" to search capacity on another date and so on.

 Coming back to where we left off.

 Run Master in turn calls two routines a. ScheduleAlternatives and b. ScheduleLimitedCapacity. Each routine will make repeated calls to "ScheduleJob" and "SlotConflict.check()".

 Though both routine make similar calls they are fundamentally different.

 Let us start with ScheduleAlternatives. To extend our example let us say we have a choice of 3 work centers for a particular job.

 ScheduleAlternatives will search all these 3 work centers for the best work center. In our example the engine will find which work center can “end” a job closest to 13th August.

 Once scheduleAlternatives determines the best fit. A call will be made to ScheduleLimitedCapacity which will schedule the job on the best work center.

 

Well thats a really short documentation but hopefully it will give you an idea of what the scheduling engine is trying to do and make your debugging easier.

Thats it folks!

 

Send mail to harry@systomatics.com with questions or comments about this web site.
Disclaimer: I am working with Microsoft Business Solutions. The code on this site may or may not be related to my official duties with Microsoft. I do not claim in any expertise in modules represented on this website. Essentially there is just one person doing functional specifications (in head), design specifications (in head), coding and some testing. There is no way the project on this site will be free of bugs. The projects are intended as guidelines and may god help you if you decide to implement the projects without making any changes. If you implement any project resulting into data corruption or anything like that then do not even think of suing me because a. I have already warned you and b. I don't have any money. I may or may not respond to your emails about supporting the project. I may or may not upgrade the projects to the next service pack / version.