JBoss Community

Re: Tasks Assigned to Groups Not Found

created by Alessandro Dionisi in jBPM - View the full discussion

Hi James,

 

thank you for the rapid answer. I've tried your solution and it works. The strange thing I found is that the query "TasksAssignedAsPotentialOwnerWithGroups" in the file Taskorm.xml in library jbpm-human-task-core-5.3.0-final.jar seems to be interpreted differently, on different Hibernate versions I think (3.6.10.Final vs. 3.2.2 GA). I noted this comparing the examples JBPM provides in the installer; if I start the human-task-server using the ant task (that references Hibernate 3.2.2.GA in the classpath) the query TasksAssignedAsPotentialOwnerWithGroups works and generates the following SQL:

 

SELECT task0_.ID AS col_0_0_, task0_.processinstanceid AS col_1_0_,

       names5_.text AS col_2_0_, subjects3_.text AS col_3_0_,

       descriptio4_.text AS col_4_0_, task0_.status AS col_5_0_,

       task0_.priority AS col_6_0_, task0_.skipable AS col_7_0_,

       task0_.actualowner_id AS col_8_0_, task0_.createdby_id AS col_9_0_,

       task0_.createdon AS col_10_0_, task0_.activationtime AS col_11_0_,

       task0_.expirationtime AS col_12_0_, task0_.processid AS col_13_0_,

       task0_.processsessionid AS col_14_0_

  FROM task task0_ LEFT OUTER JOIN organizationalentity user1_

       ON task0_.createdby_id = user1_.ID

       LEFT OUTER JOIN organizationalentity user2_

       ON task0_.actualowner_id = user2_.ID

       LEFT OUTER JOIN i18ntext subjects3_

       ON task0_.ID = subjects3_.task_subjects_id

       LEFT OUTER JOIN i18ntext descriptio4_

       ON task0_.ID = descriptio4_.task_descriptions_id

       LEFT OUTER JOIN i18ntext names5_ ON task0_.ID = names5_.task_names_id

       ,

       organizationalentity organizati6_

WHERE task0_.archived = 0

   AND (   organizati6_.ID = 'sales-rep'

        OR organizati6_.ID IN

                        ('sales', 'Crusaders', 'HR', 'Knights Templer', 'PM')

       )

   AND (organizati6_.ID IN (SELECT potentialo9_.entity_id

                              FROM peopleassignments_potowners potentialo9_

                             WHERE task0_.ID = potentialo9_.task_id))

   AND (   names5_.LANGUAGE = 'en-UK'

        OR (SELECT COUNT (names10_.task_names_id)

              FROM i18ntext names10_

             WHERE task0_.ID = names10_.task_names_id) = 0

       )

   AND (   subjects3_.LANGUAGE = 'en-UK'

        OR (SELECT COUNT (subjects11_.task_subjects_id)

              FROM i18ntext subjects11_

             WHERE task0_.ID = subjects11_.task_subjects_id) = 0

       )

   AND (   descriptio4_.LANGUAGE = 'en-UK'

        OR (SELECT COUNT (descriptio12_.task_descriptions_id)

              FROM i18ntext descriptio12_

             WHERE task0_.ID = descriptio12_.task_descriptions_id) = 0

       )

   AND (task0_.status IN

                  ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended')

       )

   AND (task0_.expirationtime IS NULL);

 

Viceversa, if I start the human-task-server in my own application that references Hibernate 3.6.10.Final the query generated is:

 

/* Formatted on 2012/08/28 12:19 (Formatter Plus v4.8.8) */

SELECT task0_.ID AS col_0_0_, task0_.processinstanceid AS col_1_0_,

       names5_.text AS col_2_0_, subjects3_.text AS col_3_0_,

       descriptio4_.text AS col_4_0_, task0_.status AS col_5_0_,

       task0_.priority AS col_6_0_, task0_.skipable AS col_7_0_,

       task0_.actualowner_id AS col_8_0_, task0_.createdby_id AS col_9_0_,

       task0_.createdon AS col_10_0_, task0_.activationtime AS col_11_0_,

       task0_.expirationtime AS col_12_0_, task0_.processid AS col_13_0_,

       task0_.processsessionid AS col_14_0_

  FROM task task0_ LEFT OUTER JOIN organizationalentity user1_

       ON task0_.createdby_id = user1_.ID

       LEFT OUTER JOIN organizationalentity user2_

       ON task0_.actualowner_id = user2_.ID

       LEFT OUTER JOIN i18ntext subjects3_

       ON task0_.ID = subjects3_.task_subjects_id

       LEFT OUTER JOIN i18ntext descriptio4_

       ON task0_.ID = descriptio4_.task_descriptions_id

       LEFT OUTER JOIN i18ntext names5_ ON task0_.ID = names5_.task_names_id

       INNER JOIN organizationalentity user7_

       ON task0_.actualowner_id = user7_.ID

       INNER JOIN organizationalentity user8_ ON task0_.createdby_id = user8_.ID

       CROSS JOIN organizationalentity organizati6_

WHERE task0_.archived = 0

   AND (   organizati6_.ID = 'cecchi'

        OR organizati6_.ID IN

                        ('sales', 'Crusaders', 'HR', 'Knights Templer', 'PM')

       )

   AND (organizati6_.ID IN (SELECT potentialo9_.entity_id

                              FROM peopleassignments_potowners potentialo9_

                             WHERE task0_.ID = potentialo9_.task_id))

   AND (   names5_.LANGUAGE = 'en-UK'

        OR (SELECT COUNT (names10_.task_names_id)

              FROM i18ntext names10_

             WHERE task0_.ID = names10_.task_names_id) = 0

       )

   AND (   subjects3_.LANGUAGE = 'en-UK'

        OR (SELECT COUNT (subjects11_.task_subjects_id)

              FROM i18ntext subjects11_

             WHERE task0_.ID = subjects11_.task_subjects_id) = 0

       )

   AND (   descriptio4_.LANGUAGE = 'en-UK'

        OR (SELECT COUNT (descriptio12_.task_descriptions_id)

              FROM i18ntext descriptio12_

             WHERE task0_.ID = descriptio12_.task_descriptions_id) = 0

       )

   AND (task0_.status IN

                  ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended')

       )

   AND (task0_.expirationtime IS NULL);

 

What do you think about it?

Reply to this message by going to Community

Start a new discussion in jBPM at Community