Data Coherence for completing user task and updating external DB


#1

Hello we use camunda as REST service in our app.
For completing user task in our app we use next code:

completeUserTask(String taskId, SpecificTaskData userData) {
     dao.update(userData)
     camundaRestApi.completeUserTask(taskId)
}

But this operation is not transactional.

I see two avaliable solution:
image

But i don’t like the idea creating service task or message receiver for each user tasks.
I think it makes a diagram unclear (more irrational).
What do you think about this problem? Thank you.


#2

hi @neki,

you can introduce a new data service on the server side which combines the taskService.complete() and saves the user data into your business database. Here you can use the Spring or JEE transaction to reach your goal.

Hope this helps, Ingo