Can't define "Default value" for Java Object "Local variable"

Hi,

I am new here and trying to understand scripting in Bonita.
At the moment I try to setup default value for Java Object of my own class com.company.model.TestObject.

I tried to base my script on: https://bonitasoft-community.github.io/bonita-camp/en/02-data-contract.html
but no matter what I do I always get: Unable to deserialize object <object-stream>

What am I doing wrong? Can anyone help?

My script:
import com.company.model.TestObject;
def test = new TestObject();
test.persistenceId = -1;
return test;

Hi,

Business object cannot be used as process variable. They must be used as Business variables only.

HTH
Romain