camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.05k stars 1.53k forks source link

External task client `setVariables` doesn't set variables correctly #4243

Closed danielkelemen closed 3 months ago

danielkelemen commented 3 months ago

Environment (Required on creation)

All versions.

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

The Java external task client setVariables uses a wrong parameter and thus it doesn't set any variables.

Steps to reproduce (Required on creation)

Observed Behavior (Required on creation)

Variables passed to the client are missing.

Expected behavior (Required on creation)

Variables passed to the client are set correctly.

Root Cause (Required on prioritization)

The client's request class implements the wrong variables property: SetVariablesRequestDto.java#L27 instead the correct modifications.

API: Process-Instance/operation/modifyProcessInstanceVariables Engine DTO: PatchVariablesDto

Furthermore, the ExternalTaskHandlerIT contains a bug as well. It doesn't fail because the we also call the complete with the same variables, which can set them correctly and this hides the aforementioned bug.

Solution Ideas

Hints

Links

Breakdown

### Pull Requests
- [ ] https://github.com/camunda/camunda-bpm-platform/pull/4236
- [ ] https://github.com/camunda/camunda-bpm-platform/pull/4281

Dev2QA handover

danielkelemen commented 3 months ago

@tasso94 a community user found this bug in the Java external client with the setVariables call. Should we backport this to older versions?

tasso94 commented 3 months ago

@danielkelemen, let's wait for customer feedback if a backport is needed.

hkupitz commented 3 months ago

Just for info: a training participant and me stumbled upon this two weeks ago. https://camunda.slack.com/archives/C80C0EC79/p1710947683545529