JBoss Community

Re: Tasks Assigned to Groups Not Found

created by Marcio Dantas in jBPM - View the full discussion

Guys,

 

in the "New' query above there's a cartesian product that brought me incorrect results.

 

Below, I change the query to use a left join.

 

 

 

select

     new org.jbpm.task.query.TaskSummary(

     t.id,

     t.taskData.processInstanceId,

     name.text,

     subject.text,

     description.text,

     t.taskData.status,

     t.priority,

     t.taskData.skipable,

     owner,

     creator,

     t.taskData.createdOn,

     t.taskData.activationTime,

     t.taskData.expirationTime)

from

    Task t

    left join t.taskData.createdBy as creator

    left join t.taskData.actualOwner as owner

    left join t.subjects as subject

    left join t.descriptions as description

    left join t.names as name

    left join t.peopleAssignments.potentialOwners potentialOwners

where

    ( potentialOwners.id = :userId or potentialOwners.id in (:groupIds) ) and

    (

    name.language = :language

    or t.names.size = 0

    ) and

    (

    subject.language = :language

    or t.subjects.size = 0

    ) and

    (

    description.language = :language

    or t.descriptions.size = 0

    ) and

    t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and

    t.taskData.expirationTime is null

Reply to this message by going to Community

Start a new discussion in jBPM at Community