In workflow 10.4.0, when using syncAvailableFieldsDelegate to synchronize data from DS I got the outdated data.
I my case, the camunda process has numbers of userTasks, when userTask is completed I need to collect data from document in order to make a next decision.
So right after userTask completed I listen task ‘complete’ event to handle that:
@EventListener(condition = "#delegateTask.getEventName().equals('complete')")
public void onTaskComplete(DelegateTask delegateTask) {
syncAvailableFieldsDelegate.execute(delegateTask.getExecution());
}
In addition, to update document and complete task - the two RPC operations MODIFY_DOCUMENT & TASK_COMPLETE are put in the same request.
Because these operations are in one transaction, so when syncAvailableFieldsDelegate.execute is triggered the change from MODIFY_DOCUMENT is not committed do database yet, therefore the returned result doesn’t contain expected data.
So in my case, how can I fetch the updated data from DS by using syncAvailableFieldsDelegate?