I don't recommend Steve's comment "For example, you can process records with a next due date that is less than or equal today." Far too complicated. I recommend that in the Organization setting for the PM to always use
zero (0) days forward
and to only select Active PM's, then to assign in each PM the
Lead to be the actual number of days in advance for the targetted start dates (this gives you lots of flex), and then to have the PMWoGenCronTask to run once a day.
You (if needed) to have multiple instances of the PMWoGenCronTask. Each running at different times to distribute the load. You will need to ensure that the
instance_pm_sqlwhere does not have PM's crossing over each other i.e. Area A, Area B, Area A + B, Area C, in this instance having Area A + B is bad, though noting other comments, even if you do, you will not generate the PM twice. It loads up the server.
------------------------------
===============================
Craig Kokay,
Lead Senior Maximo/IoT Consultant
ISW
Sydney, NSW, Australia
Ph: 0411-682-040
=================================
#IBMChampion2021
------------------------------
Original Message:
Sent: Wed May 19, 2021 08:42 AM
From: Steve Hauptman
Subject: Logic behind scheduled PMs?
There is no "order" to generating the PMs. A couple of things to keep in mind:
- Each route stop will become a work order and each task of the associated job plans will become a work order. That means you are creating 40k work orders for the route stops alone. Add 10 tasks each and that will be over 400k.
- In the organization app, you can use a where clause to filter which get processed. For example, you can process records with a next due date that is less than or equal today.
There is no parallel processing out of the box, and having two identical instances of the cron task running can cause problems. However, it is possible to set up multiple users such that each user has access to a non-overlapping subset of the PMs (say by site or some other indicator - which could be a custom field such as the user name). You can then set the run-as-user field of a series of instances to be each of those users and therefore safely run in parallel.
------------------------------
Steve Hauptman
------------------------------
Original Message:
Sent: Tue May 18, 2021 10:08 AM
From: User1971
Subject: Logic behind scheduled PMs?
For reference, here's the query that I used:
(and Craig Kokay provided an alternative query here.)
--p = source is parent WO records--pm = source is PM records--c = source is child WO recordsselect to_char(p.reportdate, 'MONTH DD') as p_reportdate_day, p.wonum as p_wonum, p.pmnum as p_pmnum, p.route as p_route, p.reportdate as p_reportdate,-- pm.pmcounter as pm_counter, pm.targstarttime as pm_targstarttime,-- pm.nextdate as pm_nextdate, c.parent as c_parent, c.pmnum as c_pmnum, c.route as c_route, c.wo_count as c_wo_count, c.min_reportdate as c_min_reportdate, c.max_reportdate as c_max_reportdate, c.processing_time_hrs as c_processing_time_hrsfrom (select * from maximo.workorder where pmnum like 'BC%' and reportedby = 'MAXADMIN' and istask = 0) pleft join maximo.pm pm on p.pmnum = pm.pmnum left join ( select parent as parent, pmnum as pmnum, route as route, max(reportedby) as max_reportedby, count(*) as wo_count, min(reportdate) as min_reportdate, max(reportdate) as max_reportdate, round((max(reportdate) - min(reportdate)) * 24,1) as processing_time_hrs from maximo.workorder group by parent, pmnum, route, changeby order by min_reportdate desc ) c on p.wonum = c.parentorder by p.reportdate desc