Service race condition

Hi

I’m using the Camunda spring boot starter. I’m getting a race condition due to resolved tasks moving from TaskService to the HistoryService.

Example

I want to get a list of tasks and their variables
taskService.createTaskQuery().taskAssignee(“someUser”).list().map { taskService.getVariables(it.id) }

so if a task is resolved/deleted after the list call and before it’s variables have been retrieved I will get a task now found error.

Is there a way for me to query the tasks and variables in together without resorting to using a native query?

Daniel

We have been struggling with the same kinds of situations here, attempting to read or update Tasks which have been deleted. We’ve finally implemented a combination of retries and ignored errors to make things proceed.

One thing we did discover along the way though, is how easy it is through scripting to tap into the native query capabilities (and more), so we have no reluctance to go that route.

Yes I could do something like that alright but it is ugly code. it will be native query I guess.