Whenever a scheduled
Apex Job is submitted, an entry is made in the
CronTrigger table. What I see is, when this job is completed successfully, I see the
State changed to "DELETED".
Based on the SOAP API Developer Guide:
The job state is managed by the system. Possible values are:
- WAITING—The job is waiting for execution.
- ACQUIRED—The job has been picked up by the system and is about to execute.
- EXECUTING—The job is executing.
- COMPLETE—The trigger has fired and is not scheduled to fire again.
- ERROR—The trigger definition has an error.
- DELETED—The job has been deleted.
- PAUSED—A job can have this state during patch and major releases. After the release has finished, the job state is automatically set to WAITING or another state.
- BLOCKED—Execution of a second instance of the job is attempted while one instance is running. This state lasts until the first job instance is completed.
- PAUSED_BLOCKED—A job has this state due to a release occurring. When the release has finished and no other instance of the job is running, the job’s status is set to another state.
Why is the state changed to "DELETED" after successful execution of the job?
Also, If I abort this job (using
system.abortjob method) the record gets removed from the
Crontrigger table. Is this correct behavior?