I have a service task that needs to make a rest call and wait for a callback.
There are two options available for me:
- Split the service task in two.
A service task making the rest call and a receive task to be notified when I receive the callback.
- Keep it as a single unit of work.
The rest call is made inside the execute method of the handler, but the complete method is not called.
Since I don’t have the instances of the ExternalTask and ExternalTaskService, I have to save the id to DB and when the callback is received I retrieve the id and use the REST API call “complete” to finish the activity.
I’ve been told that this should be a single unit of work and this split is too low level to be included into the BPMN.
Do you know what would be considered best practice in this case?
Also, if you have a better approach please let me know.
Help is highly appreciated