This content has been marked as final.
Show 2 replies
-
1. Re: Searching tasks by task variables (hibernated business o
kukeltje Mar 8, 2007 3:50 AM (in response to harrylette)did you try the hibernate ide to help you? it is good....
-
2. Re: Searching tasks by task variables (hibernated business o
harrylette Mar 15, 2007 12:29 PM (in response to harrylette)Hi,
OK, I did with the Hibernate Tools. It was a pain, to install them properly (I am also using spring). But I found the query. Here it is, for interested people:select taskinstance from Domain as dom, TaskInstance taskinstance, HibernateLongInstance as hibernatelonginstance where taskinstance.name = 'Change Provider Request' and taskinstance.isOpen = true and hibernatelonginstance.id =taskinstance.variableInstances.id and hibernatelonginstance.name = 'domain' and hibernatelonginstance.value.id = dom.id and dom.name = :varvalue
varvalue: a domain Name (class Domain has a "name" field)
This query searches a TaskInstance that has a "Domain" object assigned.
Take care: it may only work with jbpm >= 3.1.4
The TaskInstance is created like this:<task-node name="Task DomBla task"> <task name="Task DomBla" swimlane="swimlane1"> <controller> <variable name="domain" access="read"></variable> <variable name="approve" access="read,write,required"></variable> </controller> </task> <transition name="" to="isApproved"></transition> </task-node>
This way you may also list some BusinessObjects with their assigned tasks (if you skip the last line of the query)...
When I executed the query in the hibernate console (eclipse) I got a result and eclipse was getting stuck on 100% CPU for quite a while (tested on freebsd, linux and windows). Seems to be a bug in the hibernate console - however - it is beta software.
It may help anyone who neither has a clue about HQL...
Greetings
Harry