Get Process ID and its childActivityInstances using expression

Hi team,

I want to get the process ID inside a process to store it on my DB, but I want also to get all the IDs of the subprocesses I have (call activity) using an expression before it the process finishes. What is the best the best way to do this knowing I tried many options and searched on this forum but no solution gave me a good result!

Kind regards