Activiti: Serialization of variable of object

Created on 20 Oct 2018  路  8Comments  路  Source: Activiti/Activiti

Class loading problem in cloud

  • In MicroService approach, each service does not necessarily share the same class definition.Therefore, it is necessary to exchange between services by general data method.

SerializableType variable in Activiti

SerializableType variable in Activiti Cloud

blocking

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

All 8 comments

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

Was this page helpful?
0 / 5 - 0 ratings