catch(ProcessEngineException e) {
// happy path
}
// However, I can access the serialized value
ObjectValue objectValue = runtimeService.getVariableTyped(instance.getId(), "simpleBean", false);
assertFalse(objectValue.isDeserialized());
assertNotNull(objectValue.getObjectTypeName());
assertNotNull(objectValue.getValueSerialized());
// but not the deserialized properties
try {
objectValue.getValue();
fail("exception expected");
}
catch(IllegalStateException e) {
assertTextPresent("Object is not deserialized", e.getMessage());
}
try {
objectValue.getValue(JsonSerializable.class);
fail("exception expected");
}
catch(IllegalStateException e) {
assertTextPresent("Object is not deserialized", e.getMessage());
}
try {
objectValue.getObjectType();
fail("exception expected");
}
catch(IllegalStateException e) {
assertTextPresent("Object is not deserialized", e.getMessage());
}