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
Serialization of variable of object #2074
Comments
Perhaps it may be related to the following issues as well. |
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 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 |
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 #2049 |
Class loading problem in cloud
SerializableType variable in Activiti
On the other hand, Activiti can store objects as variables. In this case, it is also possible to save we own bean as a variable as it is.
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.
SerializableType variable in Activiti Cloud
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.
The text was updated successfully, but these errors were encountered: