<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Tasks Assigned to Groups Not Found
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/cecchisandrone">Alessandro Dionisi</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/756452#756452">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi James,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>thank you for the rapid answer. I've tried your solution and it works. The strange thing I found is that the query "<span style="color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #eef4f9;">TasksAssignedAsPotentialOwnerWithGroups</span>" 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 <span style="color: #555555; font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #eef4f9;">TasksAssignedAsPotentialOwnerWithGroups</span> works and generates the following SQL:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>SELECT task0_.ID AS col_0_0_, task0_.processinstanceid AS col_1_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; names5_.text AS col_2_0_, subjects3_.text AS col_3_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; descriptio4_.text AS col_4_0_, task0_.status AS col_5_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.priority AS col_6_0_, task0_.skipable AS col_7_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.actualowner_id AS col_8_0_, task0_.createdby_id AS col_9_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.createdon AS col_10_0_, task0_.activationtime AS col_11_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.expirationtime AS col_12_0_, task0_.processid AS col_13_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.processsessionid AS col_14_0_</p><p>&#160; FROM task task0_ LEFT OUTER JOIN organizationalentity user1_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.createdby_id = user1_.ID</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN organizationalentity user2_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.actualowner_id = user2_.ID</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN i18ntext subjects3_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.ID = subjects3_.task_subjects_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN i18ntext descriptio4_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.ID = descriptio4_.task_descriptions_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN i18ntext names5_ ON task0_.ID = names5_.task_names_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; organizationalentity organizati6_</p><p> WHERE task0_.archived = 0</p><p>&#160;&#160; AND (&#160;&#160; organizati6_.ID = 'sales-rep'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR organizati6_.ID IN</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ('sales', 'Crusaders', 'HR', 'Knights Templer', 'PM')</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (organizati6_.ID IN (SELECT potentialo9_.entity_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM peopleassignments_potowners potentialo9_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = potentialo9_.task_id))</p><p>&#160;&#160; AND (&#160;&#160; names5_.LANGUAGE = 'en-UK'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR (SELECT COUNT (names10_.task_names_id)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM i18ntext names10_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = names10_.task_names_id) = 0</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (&#160;&#160; subjects3_.LANGUAGE = 'en-UK'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR (SELECT COUNT (subjects11_.task_subjects_id)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM i18ntext subjects11_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = subjects11_.task_subjects_id) = 0</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (&#160;&#160; descriptio4_.LANGUAGE = 'en-UK'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR (SELECT COUNT (descriptio12_.task_descriptions_id)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM i18ntext descriptio12_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = descriptio12_.task_descriptions_id) = 0</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (task0_.status IN</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended')</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (task0_.expirationtime IS NULL);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Viceversa, if I start the human-task-server in my own application that references Hibernate 3.6.10.Final the query generated is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>/* Formatted on 2012/08/28 12:19 (Formatter Plus v4.8.8) */</p><p>SELECT task0_.ID AS col_0_0_, task0_.processinstanceid AS col_1_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; names5_.text AS col_2_0_, subjects3_.text AS col_3_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; descriptio4_.text AS col_4_0_, task0_.status AS col_5_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.priority AS col_6_0_, task0_.skipable AS col_7_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.actualowner_id AS col_8_0_, task0_.createdby_id AS col_9_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.createdon AS col_10_0_, task0_.activationtime AS col_11_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.expirationtime AS col_12_0_, task0_.processid AS col_13_0_,</p><p>&#160;&#160;&#160;&#160;&#160;&#160; task0_.processsessionid AS col_14_0_</p><p>&#160; FROM task task0_ LEFT OUTER JOIN organizationalentity user1_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.createdby_id = user1_.ID</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN organizationalentity user2_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.actualowner_id = user2_.ID</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN i18ntext subjects3_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.ID = subjects3_.task_subjects_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN i18ntext descriptio4_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.ID = descriptio4_.task_descriptions_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160; LEFT OUTER JOIN i18ntext names5_ ON task0_.ID = names5_.task_names_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160; INNER JOIN organizationalentity user7_</p><p>&#160;&#160;&#160;&#160;&#160;&#160; ON task0_.actualowner_id = user7_.ID</p><p>&#160;&#160;&#160;&#160;&#160;&#160; INNER JOIN organizationalentity user8_ ON task0_.createdby_id = user8_.ID</p><p>&#160;&#160;&#160;&#160;&#160;&#160; CROSS JOIN organizationalentity organizati6_</p><p> WHERE task0_.archived = 0</p><p>&#160;&#160; AND (&#160;&#160; organizati6_.ID = 'cecchi'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR organizati6_.ID IN</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ('sales', 'Crusaders', 'HR', 'Knights Templer', 'PM')</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (organizati6_.ID IN (SELECT potentialo9_.entity_id</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM peopleassignments_potowners potentialo9_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = potentialo9_.task_id))</p><p>&#160;&#160; AND (&#160;&#160; names5_.LANGUAGE = 'en-UK'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR (SELECT COUNT (names10_.task_names_id)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM i18ntext names10_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = names10_.task_names_id) = 0</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (&#160;&#160; subjects3_.LANGUAGE = 'en-UK'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR (SELECT COUNT (subjects11_.task_subjects_id)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM i18ntext subjects11_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = subjects11_.task_subjects_id) = 0</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (&#160;&#160; descriptio4_.LANGUAGE = 'en-UK'</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; OR (SELECT COUNT (descriptio12_.task_descriptions_id)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM i18ntext descriptio12_</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE task0_.ID = descriptio12_.task_descriptions_id) = 0</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (task0_.status IN</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended')</p><p>&#160;&#160;&#160;&#160;&#160;&#160; )</p><p>&#160;&#160; AND (task0_.expirationtime IS NULL);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>What do you think about it?</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/756452#756452">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>