DoHourlyTasks Method
- Last UpdatedMar 17, 2026
- 1 minute read
The DoHourlyTasks() method performs hourly system maintenance.
This method is called by the background service every hour. It performs the following:
- Readies jobs (state_cd=2) if the release time of a work order is older than the current date and time, and the current state for a job is New (state_cd=1) and the job is the first job in the work order, and the system attribute Initial status of the first job in a work order (attr_id=310) is set to ready.
- Reads the system attribute Archive database server name (attr_id=224) and Archive database name (attr_id=225) from system attributes, and calls a custom stored procedure sp_Archive_WO. This stored procedure has no functionality out of the box. The customer must supply the logic for this stored procedure.
- For all jobs that are currently running on the entities, an hourly bucket is created for each job in the Job_Hour_History table.
- For all jobs that ran 3 hours before the current UTC time, the statistics (runtime, downtime, idletime, qty_good, and qty_reject) are updated in the Job_Hour_History table.