Sub process doesn't inherit root process initiator

Is there a reason why a sub process doesn’t inherit the root process initiator user?

I’m testing out the sub process feature by using the Call Activity Task, and noticed that the sub process doesn’t inherit the initiator of the root process. I was able to work around it by passing in, through the process contract, the user id of the root process initiator, but it seems like it is redundant, and it should automatically work.

I found this relevant forum question, but it doesn’t have any discussion:
http://community.bonitasoft.com/questions-and-answers/actor-filter-not-working-subprocess

I get the following error in my sub process once it reaches a Human Task:
2017-01-24 12:55:41.116 -0500 SEVERE: org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork THREAD_ID=6286 | HOSTNAME=chmathispc | TENANT_ID=1 | org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException : “PROCESS_DEFINITION_ID=7606575438851366046 | PROCESS_NAME=Publisher Approval Process | PROCESS_VERSION=3.2 | PROCESS_INSTANCE_ID=4045 | ROOT_PROCESS_INSTANCE_ID=4044 | FLOW_NODE_DEFINITION_ID=5219638193148119819 | FLOW_NODE_INSTANCE_ID=80608 | FLOW_NODE_NAME=Enter Commentary | no user id returned by the user filter org.bonitasoft.engine.core.process.definition.model.impl.SUserFilterDefinitionImpl@f096373a on activity Enter Commentary”
org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: PROCESS_DEFINITION_ID=7606575438851366046 | PROCESS_NAME=Publisher Approval Process | PROCESS_VERSION=3.2 | PROCESS_INSTANCE_ID=4045 | ROOT_PROCESS_INSTANCE_ID=4044 | FLOW_NODE_DEFINITION_ID=5219638193148119819 | FLOW_NODE_INSTANCE_ID=80608 | FLOW_NODE_NAME=Enter Commentary | no user id returned by the user filter org.bonitasoft.engine.core.process.definition.model.impl.SUserFilterDefinitionImpl@f096373a on activity Enter Commentary
at org.bonitasoft.engine.execution.StateBehaviors.mapUsingUserFilters(StateBehaviors.java:316)
at org.bonitasoft.engine.execution.StateBehaviors.mapActors(StateBehaviors.java:283)
at org.bonitasoft.engine.execution.state.InitializingActivityWithBoundaryEventsStateImpl.beforeConnectors(InitializingActivityWithBoundaryEventsStateImpl.java:90)
at org.bonitasoft.engine.execution.state.OnEnterOrOnFinishConnectorState.execute(OnEnterOrOnFinishConnectorState.java:59)
at org.bonitasoft.engine.execution.state.OnEnterOrOnFinishConnectorState.execute(OnEnterOrOnFinishConnectorState.java:34)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeState(FlowNodeExecutorImpl.java:122)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.updateState(FlowNodeExecutorImpl.java:173)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.stepForward(FlowNodeExecutorImpl.java:157)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeFlowNode(FlowNodeExecutorImpl.java:300)
at org.bonitasoft.engine.execution.work.ExecuteFlowNodeWork.work(ExecuteFlowNodeWork.java:89)
at org.bonitasoft.engine.execution.work.TxBonitaWork$1.call(TxBonitaWork.java:48)
at org.bonitasoft.engine.execution.work.TxBonitaWork$1.call(TxBonitaWork.java:44)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:274)
at org.bonitasoft.engine.execution.work.TxBonitaWork.work(TxBonitaWork.java:53)
at org.bonitasoft.engine.execution.work.LockProcessInstanceWork.work(LockProcessInstanceWork.java:79)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66)
at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:47)
at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I’ve had this issue with Bonitasoft about this before and raised a bug report before however the fact that the ID is not passed is a design decision they have made.

NO user data from the calling task will be made available to the sub-process unless explicitly made so. You have to pass the data via Mapping, including the User ID.

The issue you are facing is

FLOW_NODE_NAME=Enter Commentary | no user id returned by the user filter org.bonitasoft.engine.core.process.definition.model.impl.SUserFilterDefinitionImpl@f096373a on activity Enter Commentary"

where the Actor Filter is not supplying the data you are expecting, and to be honest this is as expected.

The problem is that the sub-process is and will always be started by the System and the Actor Filter will have nothing to start with.

It’s possible that your actor filter is on the Lane - which will not work, you must put the Actor Filter on the Task specifically and pass to it a parameter, this being the ID passed via Mapping and then return from the Filter the Manager in question…

A different question though is - Why is this sub-process a sub-process and not just part of the main process? Is the sub-process used across many main-processes? If so OK, but if not then it should be part of the main process and the problem would not even occur.

regards
Seán

PS: While this may not be the complete answer you’re hoping for, it does indicate a possible solution, and if you like it, please mark as resolved.