|
|
Job Scheduling - Hard linkPlease read the job scheduling blog if you have not already done so. Well, how does this hard link work? I am talking about the technical details of course. Before jumping into the details, let us first quickly go through a few concepts. Typically scheduling engine runs through runMaster-runRoute-runJobLink-runJob. RunMaster: loops through all orders that are being scheduled. The usage is masterData.first(), next() etc. For e.g. If you have checked the box 'synchronies references' then master data may contain more than one order. RunRoute: typically loops through all route lines. The usage is rotueData.first(), next() etc. RunJobLink: This runs typically loops thru all operations on a route for e.g. primary operation, secondary operation etc. The usage is jobLinkData.first(), next() etc. RunJob: runs through all the jobs for a particular operation for e.g. setup, process etc and the usage is jobLinkData.firstjob() etc. Ok! now let us say you are job scheduling forward from today's date. Create a new item with a route that has opr num 10 and 20. Make sure 10 is scheduled with infinite capacity and 20 is scheduled with finite capacity. Also specify job link on operation no 10 as hard. Delete all capacity reservations. Create 2 production orders for the item. Now it should be obvious that first production order will not have problem getting scheduled. Say the scheduling is Opr No 10: 8 AM to 9AM Opr No 20: 9 AM to 10 AM. Now we start scheduling second production order. Opr No 10 gets scheduled from 8 AM to 9 AM. Remember we are scheduling first operation with infinite capacity. Intelligent people must have figured out that we are going to have to do some extra work with Opr No 20*s* Now without hard link the jobLinkData will contain details for operation 10 right? (look at the description at the beginning of the blog). But look at the code at line 23 of method runJobLink (I suppose I do not have tell you that this method is on class WrkCtrScheduleJobs). You will see that the code actually load operation 20 while scheduling operation 10. Without hardlink the execution would have been. RouteData Opr 10-> JobLinkData Opr 10, primary-> jobData Opr 10, primary, process time -> RouteData Opr 20-> JobLinkData Opr 20, primary-> jobData Opr 20, primary, process time With hard link the execution is RouteData Opr 10-> JobLinkData Opr 10, primary-> jobData Opr 10, primary, process time -> JobLinkData Opr 20, primary-> jobData Opr 20, primary, process time i.e. jobLinkData.next() will loop thru Operation 10 as well as operation 20. ok, to recap, for the second production order Opr 10 gets scheduled from 8 AM to 9 AM. Opr 20 gets tentatively scheduled at 9 AM to 10 AM (wrkCtrScheduleJobs_details-scheduleJob). Now WrkCtrScheduleJobs_details-scheduleLimitedCapacity will call slotConflict.check() which will detect conflict for opr 20 (since production order no 1 has been scheduled for the same date/time and we have finite capacity for this operation). So the logic will store into memory the fact that a conflict has been found. The variable is 'conflictJobPosition'. ScheduleJob will get called again and Opr 20 will get scheduled at 10 AM to 11 AM. No conflicts this time. The status in database is Opr No 10: 8 AM to 9 AM Opr No 20: 10 AM to 11 AM. Now check the code in WrkCtrScheduleJob_detaisl - mustStopReverseScheduling. Basically what this code is saying is I am on Opr 20 and we have Opr 10 on jobLinkData, (and a conflict has been detected) so obviously scheduling is xxxxxed up. Think about this and you will get it. To repeat Opr 20 is scheduled on basis of scheduled time of Opr 10 and if opr 20 has had some conflicts then the scheduling must be xxxxxed up. Got it? incidentally think over all the code lines in mustStopReverseScheduling. Very interesting and effective ways to detect the fact that one of the operations has hardLink and needs to be rescheduled. So now the logic knows that Opr no 10 has to be scheduled again. After a lot of methods returning 'false', logic reaches wrkCtrScheduleJobs - runJobLink [direction,transDate,time] = this.jobCalcDirectionDateTime(); JobCalcDirectionDateTime basically returns the start date and time of opr no 20. Since scheduling direction is forward, Opr no 10 is now scheduled backwards from this date and time. Simple eh! Whoooosh! |
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. |