When I call a defined process p2 from the process p1, (which both of them work well independently) I get the following error message and process p2 fails:
Groovy script throws an exception of type class org.bonitasoft.engine.identity.UserNotFoundException with message = org.bonitasoft.engine.identity.SUserNotFoundException: USER_ID=0 | Can’t find the user
and here is the script for business variable which is common between p1 and p2:
def businessObject2Var = new com.company.model.BusinessObject2()
businessObject2Var.userId = BonitaUsers.getProcessInstanceInitiator(apiAccessor, processInstanceId).id
return businessObject2Var
What can the problem be?
Thanks in advance
In fact this happens when I define a business variable for the process p2 which is called within the process p1. So long as I’ve not defined a business variable which userId is one of its attributes there is no problem in this way.