Reuse existing service methods and chain jobs for cleaner code and an immediate overview of your business process
JobRunr’s job chaining and workflow capabilities enhance software development efficiency by enabling logical task sequencing and complex workflow management. This setup ensures tasks execute in order, maintaining data integrity and operational consistency, especially when subsequent processes depend on earlier outcomes. The Pro version offers advanced controls and insights, further optimizing performance and providing you with an instant overview of your business process.
Job chaining via continueWith and onFailure
Running a job after another job succeeded
Running a job after another job failed
Running a job after another job succeeded or failed
Job chaining when using the JobBuilder
If you are using the JobBuilder pattern, this is also possible by means of the runAfter method.
How does it work?
the first job (archiveService.createArchive(folder)) is enqueued and will start processing as soon as some worker threads are available
the second job (notifyService.notifyViaSlack(String room, String message)) will initially be saved using the AWAITING state.
once the first job either succeeds or fails, JobRunr will look for the relevant job to enqueue and process.
This comes in really handy when using Batches - start a new step in your business process when a whole bunch of related jobs have finished.