Generate PM Work Orders Erases "activity_log_id"
We have a customer who reviews and manually generates their "Preventative Maintenance" work orders at the start of each month. Therefore, they execute the "Generate PM Work Orders" task during business hours.
We have identified an issue in the "Generate PM Work Orders" process where it is erasing the "Action Item ID" field (wr.activitylogid) from an "On Demand" work request records if the "On Demand" work request is raised at the same time as the "Generate PM Work Orders" tasks is in progress. Our customer has experienced this issue on 8 separate work requests over the past 7 months. The absence of the Action Item ID value will prevent the work request from being Issued to a Craftsperson.
We have traced the cause of this issue to the updateWorkRequests() function in the PmWorkOrderGenerator.java file, where it generates an SQL statement to update the activitylogid on the new PM work request records. However, if the Work Request Code (wr.wrid) of an "On Demand" work request happens to fall within the number range of the "Preventative Maintenance" work requests, the SQL will set the activitylog_id to NULL on the "On Demand" request. We have replicated and verified this behaviour.
Here is an example of the SQL statement that will set the activitylogid on the PM work request records:
UPDATE wr SET wr.activitylogid = ( SELECT activitylog.activitylogid From activitylog WHERE activitylog.woid= wr.woid ) WHERE wr.wrid>= 1150047294 AND wr.wr_id<= 1150047294
A solution to this issue might be to add the following to the WHERE clause of the UPDATE statement that is generated by the updateWorkRequests() function:
AND prob_type = 'PREVENTIVE MAINT'
We raised this issue with the Archibus Customer Services team and they advised us to raise this issue on “UserVoice”.
Please note that it is not a suitable workaround for this customer to schedule the "Generate PM Work Orders" task to run outside of business hours.
Would you please review this issue and please consider a method of rectification that can be applied ASAP?
Many thanks!
