cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the call hierarchy for an Execution

guillaume1
Champ on-the-rise
Champ on-the-rise
Hello,

For learning, debug and test purpose I have created a new ExecutionListener that is attached to all activities of a given process.

This ExecutionListener is triggered by the 'start' event and it is charged to display the current process and activity to the console.
If the executed activity is in a process spawned by a Call Activity process I want to display the parent process, and any grand parent in the execution path.

So a typical traces log should look like:

MyRootProcess[start]
MyRootProcess[callChild]
MyRootProcess[callChild]/ChildProcess[start]
MyRootProcess[callChild]/ChildProcess[someActivity]
MyRootProcess[callChild]/ChildProcess[end]
MyRootProcess[nextActivity]
MyRootProcess[end]

For that I'm using the Execution superExecution property, and I have some issues:
- Is there a good tutorial/documentation about the engine itself (the user manual is a bit dry on this topic
- The api doesn't allow me to get the superExecution directly. I found this property while debugging. How should I get all these info
- For some reason my way to querying the execution hierarchy is stopped after the first parent is retrieved:
       if I have A calls B calls C , then inside C I can't find that B's parent is A.

   How should I retrieve the complete execution path ?

Thanks.


3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
- There is much information to be found on https://github.com/Activiti/Activiti/wiki/Articles-and-Blogs-on-Activiti

- no, super execution is an internal thing.

- How do you retrieve it now? Are you using the ExecutionQuery and retrieve all the executions of one process instance?

Right now I'm not using the ExecutionQuery  because I was not able to retrieve anything while using it… I probably misuse it.
So I just do dirty call like this:
Execution super = execution.superExecution //this call is done in groovy, that's why I can compile it and call it).


I have tried to use the the query language with calls like
runtimeService.createExecutionQuery().processInstanceId(currentExec.processInstanceId).singleResult() but I only got 'null' answer.

Thanks for the link, I'll have a look.


jbarrez
Star Contributor
Star Contributor
hmm that's not right, runtimeService.createExecutionQuery().processInstanceId(currentExec.processInstanceId) … should at least give you the current execution. … or there is something seriously wrong!