I have a project that has the following idea:
@Transactional
public void method(){
repository.save (object1);
call workflow to do something (this will have activities that save and query from database)
historyRepository.save(historyObject1);
}
My workflow creates a object2 and other activity try to set a new status in object2.
But when this activity try to find object2 by id in database, it doesn’t exist, and I have an exception - finishing my workflow( there is no retry for not found).
IF I remove the @Transactional annotation, everything works fine, but it was added because we save in the first table and the History table.
Is this an expected behavior for workflows?
Should I move this method to a new Workflow calling thw workflow to do something, or is there other solution?
Thanks