You can also do it.
Starting from jbpm 5.4, you have the parent process id in audit tables:
https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-bam/src/main/java/org/jbpm/process/audit/ProcessInstanceLog.java#L53
At runtime, the processInstanceImpl class has the parent it in the metadata too, which is put when starting the subprocess
https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/SubProcessNodeInstance.java#L141
I think you should use the first option, but it depends on what you are trying to achieve.