Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

How to create a new Job

Michael Vorburger edited this page May 10, 2014 · 2 revisions
  1. Add NEW_JOB to JobName enum

  2. Create a void doSomething() throws JobExecutionException method annotated with @CronTarget(jobName = JobName.NEW_JOB) in a @Service. (Normally you not need to manually register your new @Service in a Spring XML due to component-scan; if in doubt, double check packages in appContext.xml.)

  3. Create a new Liquibase DB migration script include something like:

INSERT INTO job (name, display_name, cron_expression, create_time, task_priorit) VALUES ('NEW_JOB', 'This does my thing', '0 0 0 1/1 * ? *', now(), 5);

  1. TODO how to write a test