Easy Cron Job
The EasyCronJob feature is an enhancement on top of standard CronJob feature. It lets you create new cronjob at runtime with JSON parameter, so you do not need to override CronJob model.
Creating an EasyCronJob
All EasyCronJobs use the same default type which is EasyCronJobModel
. The EasyCronJobModel
is an extended class of CronJobModel
and comes with a special configuration field. In this field, you need to define your cronjob configuration as a JSON object.
So unlike standard CronJob feature, you do not extend CronJobModel
for your configuration requirements. You only need to provide your required cronjob configuration as a JSON object to EasyCronJobModel.configuration
. Please note that the EasyCronJobModel.configuration
only allows valid JSON objects (not JSON array) or empty value.
1. Create a Groovy class which extends EasyJobPerformable
In your Easy extension, create a Groovy class which extends EasyJobPerformable
class. EasyJobPerformable
itself is an extended class of standard AbstractJobPerformable
. Your JSON text configuration inside EasyCronJobModel.configuration
field will be converted into a Map object by the abstract EasyJobPerformable
class and will be passed to the performInternal
method along with the EasyCronJobModel
.
You can use all standard features of a JobPerformable
with EasyJobPerformable
:
Return CronJob results and statuses
Create abortable CronJobs
Wire and use Spring beans (services)
Use Logging
2. Define your EasyCronJobPerformable bean inside EasyBeans.groovy
In your Easy extension, define EasyCronJobPerformable
in EasyBeans.groovy
file. Since we are extending EasyJobPerformable
, the parent bean should be set to easyJobPerformable
.
The EasyBeanPerformable
bean should be defined only as a . That is why we are checking the application name because Core Context has no name.
3. Create your EasyCronJob items using Easy ImpEx
Create a ServiceLayer item for your EasyCronJobPerformable
and a CronJob item for your EasyCronJob. You can create these items within your Easy extension using Easy ImpEx.

Under impex/install
folder, create an ImpEx file
You can define a CronJob trigger if you need one.
Also, it is a good practice to create an uninstallation ImpEx file
4. Set your EasyCronJob Java properties using Easy properties
You can set the required Java properties (e.g. logging) of your EasyCronJob using Easy properties (the easy.properties file in your Easy extension)
Running your EasyCronJob
Once you have installed your Easy extension that contains your EasyCronJob, you are ready to go.
From Backoffice > Easy > Easy Core > CronJobs link you can view, create, modify, delete or start your EasyCronJobs.

EasyCronJob editor comes with "EasyCronJob Configuration" tab that is fully dedicated for your cronjob configuration which needs to be a JSON object

EasyCronJobs are standard CronJobs and you can still use standard Backoffice > System > Background Processes > CronJobs link to view, create, modify, delete or start your EasyCronJobs.
