Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038804Openbravo ERPA. Platformpublic2018-06-21 12:472019-10-22 16:30
jarmendariz 
platform 
normalminoralways
closedfixed 
5
 
 
caristu
Core
No
0038804: jobUnscheduled method in ProcessMonitor is never called
ProcessMonitor::jobUnscheduled() is never called when a job is unscheduled because the OB_GROUP is not used when creating Triggers at process schedule. This may affect other methods in ProcessMonitor as well.

This issue is caused because when unscheduling a job, Quartz attempts to remove the trigger given the trigger and the group names, but trigger group is set as DEFAULT instead of OB_QUARTZ_GROUP so no deletion is performed and then the Scheduled listeners (ProcessMonitor) are not notified.
- Put a breakpoint in the jobUnscheduledMethod of ProcessMonitor class.
- Start tomcat in debug mode
- Go to Process Request
- Select an scheduled process
- Press "Unschedule Process" button
- Process should be unscheduled and the breakpoint is never reached.
When a job is scheduled, it uses TriggerProvider:newInstance(String, ProcessBundle, ConnectionProvider) to create a new Trigger. The trigger group should be set using trigger.setGroup(OB_GROUP) for scheduled triggers (data.timingOption.equals(TIMING_OPTION_SCHEDULED).

Then some testing should be performed to ensure no functionality is broken for this change and that all methods of ProcessMonitor are called.
No tags attached.
related to defect 0038766 closed jarmendariz audit fields don't get updated when scheduling/unscheduling process requests 
related to feature request 0041483 closed caristu update quartz 
Issue History
2018-06-21 12:47jarmendarizNew Issue
2018-06-21 12:47jarmendarizAssigned To => platform
2018-06-21 12:47jarmendarizModules => Core
2018-06-21 12:47jarmendarizTriggers an Emergency Pack => No
2018-06-21 12:51jarmendarizRelationship addedrelated to 0038766
2018-06-21 14:11jarmendarizNote Added: 0105305
2018-07-06 09:18alostaleSeveritymajor => minor
2018-07-06 09:18alostaleStatusnew => acknowledged
2019-10-09 18:02caristuRelationship addedrelated to 0041483
2019-10-22 16:27caristuStatusacknowledged => scheduled
2019-10-22 16:30caristuReview Assigned To => caristu
2019-10-22 16:30caristuNote Added: 0115230
2019-10-22 16:30caristuStatusscheduled => closed
2019-10-22 16:30caristuResolutionopen => fixed

Notes
(0105305)
jarmendariz   
2018-06-21 14:11   
When fixing this issue, consider removing the update:
ProcessRequestData.update(getConnection(), UNSCHEDULED, null, null, null, "0", triggerName);

in ProcessMonitor::unscheduleJob, as this update is already made in OBScheduler.
(0115230)
caristu   
2019-10-22 16:30   
After upgrading quartz to version 2.3.1 (0041483), the jobUnscheduled method is now invoked, but its implementation is not needed because when unscheduling a process, the OBScheduler is already taking care of updating the AD_PROCESS_REQUEST information properly (in the unschedule method).

So the implementation of the jobUnscheduled was removed[1] because it was no longer needed.

[1] https://code.openbravo.com/erp/devel/pi/rev/7b818134d882 [^]