[jboss-user] [jBPM] - Variables Performance

Andre Muniz do-not-reply at jboss.com
Thu Mar 25 14:18:07 EDT 2010


Andre Muniz [http://community.jboss.org/people/andre.muniz] created the discussion

"Variables Performance"

To view the discussion, visit: http://community.jboss.org/message/534048#534048

--------------------------------------------------------------
Hi!

My use case is very simple: I need to load all the pending tasks and show information about them (including variables). But I'm having some performance problems when loading those variables.

Basically my code is like this:


// Builds the process engine
ProcessEngine processEngine = new Configuration().buildProcessEngine();
 
// Creates the services
TaskService taskService = processEngine.getTaskService();
ExecutionService executionService = processEngine.getExecutionService();
 
// Loads all the pending tasks
List < Task > tasks = taskService.createTaskQuery().list();
 
// Loads the variables for each task
for (Task t : tasks) {
 
     // Variable names
     Set < String > variableNames = new TreeSet < String >();
     variableNames.add("var1");
     variableNames.add("var2");
     variableNames.add("var3");
     variableNames.add("var4");
     variableNames.add("var5");
 
     // Loads the variables
     Map < String, Object > variables = executionService.getVariables(t.getExecutionId(), variableNames);
            
     // Shows variables information
     System.out.println(variables);
}



The "taskService.createTaskQuery().list()" method is very fast, but the processing time to load the variables is very high.

My question is:
Am I going in the right direction or there is another way to implement this use case with better performance?

PS: I've seen the JIRA request to include searching for process instances by variables ( https://jira.jboss.org/jira/browse/JBPM-2505 https://jira.jboss.org/jira/browse/JBPM-2505) and there are some comments about variable performance, but I'm not sure that in my use case I should have this kind of problem.

Thanks!

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/534048#534048]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100325/b60aa1ba/attachment.html 


More information about the jboss-user mailing list