Finding Parent Execution With RuntimeService
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2012 07:34 AM
Hi,
I've 2 layers: Parent Process and 3 child processes which are call activities. These 3 callactivities are parallel to each other.
As I started parent and query for parent I got 4 instead of 1.
1
I checked 4 of them by debugging, and I see 3 of 4 are parallel executions, so their parentId values are null. They have same processInstanceId and processDefinitionId. After that inspection I started to use
2
This returns null. Also
3
returns null. The last one should be the same as first query. Because I query processDefinitionKey in both but one of them gives exception the other null. What should I do?
I've 2 layers: Parent Process and 3 child processes which are call activities. These 3 callactivities are parallel to each other.
As I started parent and query for parent I got 4 instead of 1.
1
runtimeService.createExecutionQuery().processDefinitionKey("level1Process").singleResult();
I checked 4 of them by debugging, and I see 3 of 4 are parallel executions, so their parentId values are null. They have same processInstanceId and processDefinitionId. After that inspection I started to use
createNativeExecutionQuery()
but I couldn't get what I want:2
runtimeService.createNativeExecutionQuery().parameter("parentId", null).parameter("processDefinitionKey", "level1Process").singleResult();
This returns null. Also
3
runtimeService.createNativeExecutionQuery().parameter("processDefinitionKey", "level1Process").singleResult();
returns null. The last one should be the same as first query. Because I query processDefinitionKey in both but one of them gives exception the other null. What should I do?
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2013 04:38 AM
I don't fully grasp what you are trying to do: but when you are using a call activity, it will call another process definition, hence the process definition key will be different. Did you try using the 'superProcessInstanceId' in your query?
