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.
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'sTaskQueryClient
. These queries return aTaskQueryResult
, which again contains aio.holunda.polyflow.view.Task
. This task provides the process variables aspayload
within a camundaVariableMap
. If I usedcamunda-bpm-data
'sVariableWriter
to write process variables, and polyflow handles the exact same data structure, which theVariableReader
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 aWrongVariableTypeException
, since the type information are no longer stored in theVariableMap
, 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 playMap<String, Object>
data type, to take that confusion away.Possible Workarounds
Since a
VariableMap
is aMap<String, Object>
, one can handle it the same way, but one need to know, that one cannot use theVariableReader
, but to convert all values manually.