Cant update business data modells attribute in the process variables

Lets say i have a business data modell that has person and also puppy. Each object can exist independent from each other, however person have a puppy object, that can be null, it is not mandatory.

I have a process, and a business variable, the type is person. I give the person some data, and an existing puppy object. That means i will have a new line in the person table, and one existing line from the puppy object will be referenced to this line by persistenceId (if i understand this correctly).

My problem is, after creating this person object, i want to modify it. I want to remove the puppy, because the person gave it to his friend i dont know, the thing is i need to set the puppy object to null in the person object.

This doesnt work when i set it to null in the tasks execution/operation with groovy script returning null.
In bonita log, i get the error the puppy cant be deleted from the table (this is not the exact messige, but this is what i understand from it). But setting and object reference to null shouldnt be a problem, why does bonita want to delete the puppy object from the database? And how can i remove az existing object from another object?

thank you in advance!

In bonita log, i get the error the puppy cant be deleted from the table (this is not the exact messige, but this is what i understand from it)

Maybe, you’re trying to delete the puppy ( set pupy object to null) instead of set the puppy_id in your person table to null ?

That could work probably, but after i submit a task i can only change the business variable in the operations, and i am trying to use the objects java method to do that. There i cant set the puppy_id, only the puppy object.