ok here is my final query. sorry for the multiple posts, but I made some changes at the last second:
| select a.* from jbpm_variableinstance a, (select processinstance_ from | jbpm_variableinstance where name_ = 'XYZ' and stringvalue_ = '364834') subView, | jbpm_processinstance b, jbpm_processdefinition c, jbpm_taskinstance d | where a.processinstance_ = subView.processinstance_ | AND a.name_ = 'ABC' | AND b.id_ = subView.processinstance_ | AND b.end_ IS NULL | AND c.name_ = 'My Process' | AND d.token_ = a.token_ | ORDER BY a.stringvalue_; | This final query also joins the process definition table so as to query based on the process definition name. Finally it also joins the token in the variableinstance table to the token in taskinstance table. The end result of all this is a retrieval of all tasks from a given process instance where the process instance contains two variables (one with a given name and value and the other with a given name). The last step is to join on jbpm_taskdefinition to get a certain task by name. Long story short I'll get the tasks and value of the variable. If anyone's interested I'll post the final query. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3929966#3929966 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3929966 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user