bpm-crafters/process-engine-api

Create a possibility to react on task removal after delivery to a handler

Closed this issue · 0 comments

Current

After the subscription, the task handler will eventually be invoked with a concrete TaskInformation and payload. For the synchronous execution this is ok, since the handler can call TaskApi.complete method. For the asynchronous execution (the handler call stack is interrupted between the delivery of the task and task completion) this will be a problem, if the task is not available anymore.

Example

The handler is creating a pool of tasks available (e.g. for user tasks), the task gets completed or deleted and there is no way to signal this to the pool.

Proposal

During the registration, we provide an additional callback to be called by the implementation if the task is not available AFTER it has been passed to the handler.

Usage examples

  • External task times out
  • External task is deleted
  • User task is completed / deleted

Conclusion

on events above the task handler gets notified that the task is not available anymore and can react accordingly.