cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Null values for attributes of Serializable Objects

jainita
Champ in-the-making
Champ in-the-making

I am using activiti-spring-boot-starter-basic version 5.22.0. I Have two enpoints in my controller. 1: Initializes a user task and goes into a wait state. 2: completes the user task. I have stored a serializable object before creating a user task in the 1st endpoint and stored it as a process instance variable. When I am trying to retain the serializable variable in the second endpoint with the same process instance id as used in first endpoint I get the object but the values of all the attributes in the object are being retained as null.

I have tried two methods
1. I tried using runtimeService.getVariable(instanceid,"variableName")
2. I used management service and accessed "ACT_GE_BYTEARRAY", obtained the byte_array data and converted it into Object

both the methods above gives the same results

(NOTE: The attributes of my object are not transient)

Is this a bug or m I doing something wrong?

Can we not retain serializable objects values in activiti for long?

1 REPLY 1

sarveshmvm
Confirmed Champ
Confirmed Champ

Hello,

How are you setting the variables first? Did you add them as data objects ? 

Did you check activiti_ru_variable table for the values. Also, make sure the data type you use should match when you try to retrieve. The null values are obtained only if the activiti_ru_variable table have the variable value as null.