# How to skip DeadLetterJob

**URL:** <https://forum.flowable.org/t/how-to-skip-deadletterjob/4016>\
**Category:** Flowable Engine\
**Created:** [June 13, 2019, 8:02pm UTC](https://forum.flowable.org/t/how-to-skip-deadletterjob/4016 "2019-06-13T20:02:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![holgerapel-iso](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@holgerapel-iso](https://forum.flowable.org/u/holgerapel-iso)\
**Post date:** [June 13, 2019, 8:02pm UTC](https://forum.flowable.org/t/how-to-skip-deadletterjob/4016/1 "2019-06-13T20:02:57Z")

</div>

Hi there,

I am trying to find out what the best way is to skip async serviceTasks which ended up as a deadLetterJob. I want to continue the process without rerunning the job. My current approach is to define skip expressions for the serviceTask based on process variables and then inject those variable before rerunning the job. Is there a another way? Because I may not always have a skip expression defined.

Any guidance is appreciated

Holger

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [June 18, 2019, 7:16pm UTC](https://forum.flowable.org/t/how-to-skip-deadletterjob/4016/2 "2019-06-18T19:16:28Z")

</div>

Hey Holger,

The easiest way to solve this would be for your ServiceTasks to throw a `BpmnError` or use the `mapExceptions` of the task to be able to propagate and model that.

In case you don’t want to model that then it is not really easy to do it and you would need to work with extremely low level APIs and this is something that I would not suggest to do. If you really really want to go down that path then I would suggest to look into `AsyncContinuationJobHandler` and use a custom `ContinueProcessOperation` that would ignore the exception in there.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![holgerapel-iso](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@holgerapel-iso](https://forum.flowable.org/u/holgerapel-iso)\
**Post date:** [June 20, 2019, 1:39pm UTC](https://forum.flowable.org/t/how-to-skip-deadletterjob/4016/3 "2019-06-20T13:39:50Z")

</div>

Thank you Filip,

I agree throwing BpmnError and modelling an error path would be a valid choice, but since we have lot’s of automated tasks in our process it makes the diagram quite verbose. So I was looking for alternatives for cases where a user can basically retry the automated task or continue with the process.

I was hoping there would be a similar approach as for service tasks which are triggerable, e.g. to use the RuntimeService triggerAsync methods to continue the process.

Anyway thanks for your help  
Holger

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [June 20, 2019, 2:29pm UTC](https://forum.flowable.org/t/how-to-skip-deadletterjob/4016/4 "2019-06-20T14:29:02Z")

</div>

This is not available out of the box. One path (haven’t tested it) could be to

- Create a custom command (execute it through the ManagementService) that
  - Fetches the ExecutionEntity related to the job
  - Deletes the job from the deadletter table
  - Calls CommandContextUtil.getAgenda(commandContext).planContinueProcessSynchronousOperation(executionEntity);

This mimics the behavior of [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/impl/jobexecutor/AsyncContinuationJobHandler.java](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/impl/jobexecutor/AsyncContinuationJobHandler.java)
