I have a java object that is set as process variable, but it I get error when I try to deserialize it using REST API. Here is the error I get
“type”: “ProcessEngineException”,
“message”: "Cannot deserialize object in variable ‘ACTIVITY_TRACKER’: ENGINE-09017 Cannot load class.
the java class is as below. Both the parent and the dependent class implement java.io.Serializable
public class ActivityTracker implements java.io.Serializable {
public static ArrayList<ActivityInfo> activityList = new ArrayList<ActivityInfo>();
public void addActivityInfo(ActivityInfo activityInfo){
this.activityList.add(activityInfo);
}
public void removeActivityInfo(ActivityInfo activityInfo){
this.activityList.remove(activityInfo);
}
}
I have tried to follow the document to use specific serializer as well when setting the variable.
ObjectValue activityTrackerDataValue = Variables.objectValue(activityTracker)
.serializationDataFormat(Variables.SerializationDataFormats.JAVA)
.create();
delegateExecution.setVariable("ACTIVITY_TRACKER", activityTrackerDataValue );