Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Task payload as plane Map instead of camunda VariableMap #844

Open
mmiikkkkaa opened this issue Jul 21, 2023 · 1 comment
Open
Labels
Type: breaking This is a breaking change. Take care while migrating.

Comments

@mmiikkkkaa
Copy link
Contributor

Scenario

Within an application, that uses camunda (of course with best-practice lib camunda-bpm-data to store process variables) and polyflow, one can query tasks via polyflow's TaskQueryClient. These queries return a TaskQueryResult, which again contains a io.holunda.polyflow.view.Task. This task provides the process variables as payload within a camunda VariableMap. If I used camunda-bpm-data's VariableWriter to write process variables, and polyflow handles the exact same data structure, which the VariableReader is normally able to read, than as developer I'm tempted to use reader, to retrieve the values again from the variable map.

Current Behaviour

Depending on the type of process variable (in this case all non-string data types), the VariableReader throws a WrongVariableTypeException, since the type information are no longer stored in the VariableMap, but everything was serialized to plain string json object. Deserializing it to the desired data types is no longer possible.

Wanted Behaviour

Since it is totally comprehensible, that the values are serialized into a plain json string, the fact, that the task object returns the payload as VariableMap confuses into thinking it should work. Therefore, the Payload should better be returned as play Map<String, Object> data type, to take that confusion away.

Possible Workarounds

Since a VariableMap is a Map<String, Object>, one can handle it the same way, but one need to know, that one cannot use the VariableReader, but to convert all values manually.

@zambrovski
Copy link
Member

You are absolutely correct with your observation, but the change is breaking (breaks existing contract of the View API).

@zambrovski zambrovski added Type: enhancement New feature or request Type: breaking This is a breaking change. Take care while migrating. and removed Type: enhancement New feature or request labels Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: breaking This is a breaking change. Take care while migrating.
Projects
None yet
Development

No branches or pull requests

2 participants