[jboss-user] [JBoss jBPM] - Re: Searching tasks by task variables (hibernated business o

hstrack do-not-reply at jboss.com
Thu Mar 15 12:29:01 EDT 2007


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



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

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



More information about the jboss-user mailing list