Some fellow devs in the Force.com community shared a new conception of creating and managing scheduled jobs in Salesforce. It was borne from a deployment bug that appears when deploying a scheduled class into an org in which the class is already scheduled to run. This app claims to solve this problem by managing scheduled jobs through data records, which can be safely deployed. What’s more, the app boasts a more user-friendly front-end for creating and updating Apex classes. I was quite interested to see this in action, so I installed the package. Here are my impressions.
Before installing, read the author’s announcement blog post first, to get the details from the horse’s mouth. Then, find the link to the beta managed package at the bottom of the post to install it into a sandbox or DE org.
After installing the package, you can find that a new tab has been created, called ‘Jobs’, which will be your new means of scheduling Apex classes. This is a standard object tab that shows a list of existing records, each of which represents a single Apex class that is scheduled for execution. This is the only front-end to the app, so having covered it, let’s see walk through a few use cases.
Apex Scheduler Replacement
One of the things that Skoodat Relax wants to solve is the complexity of managing scheduled Apex jobs that standard Salesforce functionality provides. You could schedule an Apex class using standard functionality, by going to Setup > Develop > Apex Classes and clicking the ‘Schedule Apex’ button to create a job, but to update and stop these jobs, you then have to go to Setup > Monitoring > Scheduled Jobs. This is not intuitive at all. Skoodat Relax, on the other hand, will create and update these places for you whenever you create or update the Job record that manages these jobs, which is a much cleaner way of managing jobs.
To schedule a single Apex class using Skoodat Relax, navigate to the Jobs tab, click the ‘New Job’ button, enter an arbitrary identifier in the Name field, and select the ‘Run Individually’ checkbox. Each Job record you create in this manner will create a new scheduled job in the list located at Setup > Monitoring > Scheduled Jobs. To deschedule an Apex job and remove it from this list, simply edit the associated Job record and deselect the Active checkbox.
Batch Apex Booster
The other feature that Skoodat Relax easily enables is executing one batch job immediately after another batch job is finished. While I, myself, haven’t encountered the need to do this, it’s an interesting problem that other Force.com developers have. Essentially, if you have two or more Batchable Apex classes, you can easily chain them together by having them extend the Skoodat Relax BatchableProcessStep class. Once they are a BatchableProcessSteps, they will appear as options in the Aggregable Apex Class field on the Job edit page. If you want BatchB to run immediately after BatchA, set the Order field of BatchB to 2, and the Order field of BatchA to 1.
To conclude, I want to point out that this is still a beta package, and I noticed a bug or two in my testing. The bugs were nothing serious, but enough that I would recommend users to not install this in a production org until they have thoroughly tested it for their use case in a sandbox. It is a managed package, so the source code will not be available for review. Likewise, we can’t be sure of the pricing and support model until it is publicly released on the AppExchange. Until then, you will have to live with the pains of the standard Salesforce scheduling interface.