Our business process that is backing our web app has the following flow:
- message receiver (that receives a message when our business user accepts some terms, can be from UI or some downstream service)
- service task in Java that actually updates whatever it needs to update when the user accepts the terms.
Now, this has to be a synchronous step (as it is a HTTP request) for business users, meaning, we need to notify him immediately about the success of the operation in the response to his request.
What is the best way to model this? I see the following options:
1
Add the third step that is a message throw, indicating that the service task completes; and wait for the message in the Java code.
This would allow any number of tasks between the receiving and sending the message.
However, any such synchronous operation would require both receive/send messages around service task(s).
2
Don’t add anything, assume service task works, and add an Error boundary event that would be handled by some generic Java error handler. In other words, we assume all synchronous operations are executed, and errors are coming asynchronously.
3
Remove service task from the flow, and execute the same code before sending the message.
This would get user interaction out of the flow, but also the services.