Has nobody have an idea?
Is this solved with jbpm 3.1?
As you might already know, only tokens positioned at process states contain a non-null subProcessInstance value. The reference will be gone when the token moves to another node. Furthermore, if the process state occurs in a forked line of execution, a child token will contain the subProcessInstance reference, rather than the root token.
I looked at the solution you proposed in JBPM-477. Testing for a subProcessInstance in the root token is not enough. You have to traverse all descendant nodes recursively, via Token.getChildren() or Token.getActiveChildren().