1 of 1 people found this helpful
Hi Asad, just for curiosity.. why you would need to query tasks using variables? I don't know how you could make it, as task input and output seems to be serialized in Content table. You could query tasks by other criteria (from Task, TaskSummary, OrganizationalEntity) as it is done in orm.xml places in human tasks. You can just create an EntityManagerFactory like
entityManagerFactory = Persistence.createEntityManagerFactory("org.drools.task")
And then use the EntityManager to make queries.
About getting access to task variables, as said before, they are serialized content. You can check here to see how to get the variables:
Thanks for your reply. I basically need it because I am not building my processes into jbpm from scratch, instead i am trying to incorporate it into an existing monolithic app. Since the Front end already exists, being able to query tasks based on their vraiables would allow me to make an incremental change and use the same UI to fetch certian types of tasks.
From you comment about all that being serialized it seems, I might need to just do this in filtering in the app itself. Hopefully scale wont be an issue.
I agree that variables should be stored not as serialized data but in some tabels... some time ie you would like to see all the processes which have some variable set to specific value.
Well, in the case of processes you can use the audit data (jbpm-bam), which will record nodes, variables and objects (as strings). And it also could be extended to fit your needs.