Schedulr: A cfschedule front end for Lucee

A lightweight interface for cfschedule on Lucee

Schedulr: A cfschedule front end for Lucee

I have been meaning to look into using Lucee as a way to kick off scheduled tasks. Many of the projects I deal with on a daily basis require some level of automation, whether that comes from a cron job, a Nifi processor, or a similar process. It also gave me an excuse to get back in to Bulma, a CSS framework I have used before building some developer tools at work. The UI was built in Vue since that is the library I am most familiar with. All the application plumbing was built using ColdBox, again because it is easy to get an application up and running quickly.

The application is built simply. The main application layout handles loading all the required JS and CSS files. The file /assets/js/main.js file controls the UI. The main view, views/main/index.cfm contains all the html for the application.

Schedulr UI

The UI covers all the actions available to cfschedule: update, pause, resume, run, and delete. The validation for updating a task is loose and fast, but I will continue to drill down on it. The interval value could also use some TLC.

Another awesome feature that Lucee has out of the box that Adobe ColdFusion does not support is the ability to run the each() operator in parallel. This sounds innocuous enough, but lets assume I wanted to simulate a Nifi processor that kicks off multiple cfhttp requests. I created a ColdBox handler specifically for tasks that require a little extra logic.

function pollSites (event, rc, prc) {
    var sites = [
    	'https://www.google.com',
        'https://www.yahoo.com',
        'https://www.msn.com'
    ];
    sites.each((site) => {
        cfhttp(url = site);
        // do stuff in parallel
    }, true);
    return {
    	"success": true
    }
}
Do stuff in parallel

Now I can call pollSites in Tasks.cfc and kick off all the requests and simulate Nifi kicking off the daily API pull.

If you would like to check it out you can find it here:

robertz/schedulr
Leverage Lucee cfschedule to run scheduled tasks. Contribute to robertz/schedulr development by creating an account on GitHub.