But, if the object includes its own bean, there is a possibility that deserialization can not be performed when reading with the cooperation destination service(like connector services).
In Activiti Cloud, it is necessary to limit the ability to store variables with its own bean.
However, Activiti Cloud currently relies on SerializableType. Activiti Cloud saves the object deserialized by Jackson by Spring Framework as it is in a variable.
In order to avoid the above, we need to save the variable as JsonNode. If we save it as JsonNode, the result serialized as json is saved in the variable, and there is no problem of deserialization.
Perhaps it may be related to the following issues as well.
https://github.com/Activiti/Activiti/issues/2049
The way to get a Serializable variable value is to do:
SomeSerializable myVar = (SomeSerializable) runtimeService.getVariable(processInstance.getId(), "myVar");
Doing getValue on a list of variable instances is not recommended, because for a list of 10 Serializable variables this would mean 10 database calls to the ACT_GE_BYTEARRAY table.
@qiudaoke
Thanks. I see.
But, after understanding it, we are discussing the method of serialization here.
SerializableType is Java's native serialization method, but this should not be used in a cloud environment. It is an argument that JSON should be used.
Using json is a good suggestion.
Is anyone currently working on this? Just want to check what the current status is.
@ryandawsonuk
Sorry. I'm not working on this now. No progress.
That's fine, thanks for the update.
FYI, I'm now working on providing a way to serialize to json without needing the type of the variable object to be JsonNode - work ongoing under https://github.com/Activiti/Activiti/commits/balsarori-2049-process-vars-extension for https://github.com/Activiti/Activiti/issues/2049
Most helpful comment
FYI, I'm now working on providing a way to serialize to json without needing the type of the variable object to be JsonNode - work ongoing under https://github.com/Activiti/Activiti/commits/balsarori-2049-process-vars-extension for https://github.com/Activiti/Activiti/issues/2049