ProcessInstanceQuery and runtime performance
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2011 09:49 AM
Hi,
I defined a process that performs different tasks. During the execution of the process it evaluates new variables.
I have to show a web page with the list of processes that satisfy a certain condition on one of the variables.
I have successfully run a ProcessInstanceQuery().list() method with a filter on that variable
That method returns a list of ProcessInstance.
However the single element in the list contains only the id of the process instead I also need the value of a variable of the process.
I tried to cast the ProcessInstance to ExecutionEntity and use the method getVariabile("my var") but I get a "lazy loading outside commandContext" error.
The only alternative seems to loop on the list of results and execute a runtimeService.getVariable("my var") for each element.
Is there a better way to do this in a efficient way (not too many sql queries requests)?
best regards
I defined a process that performs different tasks. During the execution of the process it evaluates new variables.
I have to show a web page with the list of processes that satisfy a certain condition on one of the variables.
I have successfully run a ProcessInstanceQuery().list() method with a filter on that variable
That method returns a list of ProcessInstance.
However the single element in the list contains only the id of the process instead I also need the value of a variable of the process.
I tried to cast the ProcessInstance to ExecutionEntity and use the method getVariabile("my var") but I get a "lazy loading outside commandContext" error.
The only alternative seems to loop on the list of results and execute a runtimeService.getVariable("my var") for each element.
Is there a better way to do this in a efficient way (not too many sql queries requests)?
best regards
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2011 01:13 PM
Hi,
You can write your own database queries to overcome this.
Else you're stuck with the runtimeservice getVariable method.
Best regards,
You can write your own database queries to overcome this.
Else you're stuck with the runtimeservice getVariable method.
Best regards,
