Complex type usage best practice


I would like to use an empty pojo in my BPMN process and set during the flow.
For example:
class person{
private Name name;
private String birthplace;
private Address address;

add the person to the execution with startProcessInstanceByKey(processName,businessKey, person)

If I would like to use the variables as ${} I got an error that the name is not exsiting what is true :(.

Do you have any idea how can I create the pojo to use the expression without any hack?

My workaround is to manipulate the pojo generation and if you use the getter method I create the object if that is not existing. In my opinion this is a bad practice.

The whole process looks like that I get a json-schema or XSD and the pojo was generated from that one.

Thanks in advanced: Gáboor

Hi Gábor,

I can’t imagine a practice other than populating the POJO with default values that would avoid this exception. You could move that logic to the constructor instead of the getter if that makes it better for you. I would also not consider this bad practice.


Thank you the answer.