Can someone plz reply ASAP if there is a way to persist variables set using execution.setVariables in case service task throws an exception.
The use case is 4 service tasks in a row. 4th task throws an exception. Process rolls back to last user task (deleting success response from 1st 3 service tasks). Now when user re-submits, first 3 service tasks are again called. Problem is we can call one of the first 3 services only once after success is returned, after that it will send us error response and if we receive error we throw exceptions from service task. Now user is stuck because we are getting error response from that service and user cannot move forward.
But if somehow i can persist the response in variables, i can use that to re run the logic and not hit the api and user can just move forward.
Depending on your requirement, you can mark your service tasks as asynchronous.
This will commit the transaction, so that if you get an exception, it will not roll back.
In this case you need to handle the exception case so that your process does not stall.
Or you can do compensation. Have a look at the documentation.
Using this you can cause the other service tasks to roll back in a controlled way so that, when the user tries a second time, all the service tasks are ready to process the transaction instead of giving you an error.
Anyone identified solution?
We are in flowable 7.1. When we go for Async, flow is not waiting for Async task to close, but next task need input from previous task. So we are using synchronous service tasks.
We have a chain of external Bank API calls in which few are create requests, which should not be called again for same request data.