[jboss-user] [JBoss jBPM] - Re: Fetching Task Variable Instances (Early Loading)

bradsdavis do-not-reply at jboss.com
Sun Mar 29 17:42:41 EDT 2009


Yeah, my suggestion here is the following.

First, I dont think this is as efficient as it should be.  However, this is my suggestion at the most efficient result.

Create a DTO that includes the values you want in the grid.  Then do a HQL query to fetch the task instance.  The key is to make the variable local to the task instance so that it can be pulled in a eager fashion.

So, when you create your task, just add a controller that copies the value from the process instance to the task.  That is equivalent to creating a variable locally on the task instance.

So, then you need to fetch the variable eagerly.


  | "select task from org.jbpm.taskmgmt.exe.TaskInstance task fetch all properties left join fetch task.variableInstances varInstance"
  | 

When you are populating your DTO from your TaskInstance objects gathered in the HQL query, make sure you say "getVariableLocally("variableName") rather than the getVariable method.  That is crucial.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221795#4221795

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221795



More information about the jboss-user mailing list