Closed lbilger closed 1 year ago
Nice one... Side effects over side effects... Thank you for reporting. Are you already working on a solution?
Without looking on he code, I can think of a filter inside the collector, determining that the historic update
command is sent alone and transforms that into an update command then...
I thought in a similar direction and wanted to implement it, but found that the businessKey
is missing in the historic event. Then I saw that Camunda is actually sending the update event, we are deliberately suppressing it in TaskEventCollectorService
. So my suggestion would be to just not suppress the update event. I will submit a PR soon.
Reopening this, because the merged PR turned the pipeline red.
Steps to reproduce
Complete executable reproducer: consider the following test method added to
TaskCollectorITest
:This is a slight variation on
updates attributes via API with update listener
where nothing is actually changed in the task. This might seem futile but in our setup, it is used to force a task update after process variables have changed.The command sent to the gateway is not an
UpdateAttributeTaskCommand
but anUpdateAttributesHistoricTaskCommand
. From that class's description:This command has no command handler in the core and is never sent to it.
It is not intended to be sent to the gateway but should be merged into other commands by the accumulator, which doesn't happen if it's the only command.So the problem is that without changes to the task, no
UpdateAttributeTaskCommand
is created and thus theUpdateAttributesHistoricTaskCommand
stands alone where it never should.taskService.saveTask()
with an original, unchanged task.Expected behaviour
Calling saveTask() with no changes to the task itself should create an
UpdateAttributeTaskCommand
enriched with the current process variables.Actual behaviour
An
UpdateAttributesHistoricTaskCommand
is issued which cannot be processed and an exception is thrown: