cancel
Showing results for 
Search instead for 
Did you mean: 

Skip execution of async service task

mrosenfeld
Champ in-the-making
Champ in-the-making
Hello,

I customized the FailedJobCommandFactory to make the job executor not try to execute an async service task when it fails. This is because the multiple execution of the service task can have undesirable consequences, for instance, calling twice an external service.

Then I query the jobs using the ManagementService and analyze each case in particular, i.e. why and where it failed. In some cases, I would re-execute the job. But in others I would like to skip the service task and force the workflow to advance. Is it possible?

Thanks!
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Yes, that is possible. See my comment here: http://forums.activiti.org/content/how-customize-retries-count-actrujob-table

property of the process engine configuration), to return a modified version of the DecrementJobRetriesCmd. You could set the job-retries to zero instead of the current "job.getRetries() - 1" value.

This will work for all jobs that fail. Offcourse, you can manually set the retry count to 0 for all jobs in your code, however, this requires you to call code fore every timer/job created.