Skip to content

Commit

Permalink
Merge branch 'master' into 'release-10.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bonita-ci committed Feb 22, 2024
2 parents aa5c1ad + f7ba32b commit bfd93f9
Showing 1 changed file with 22 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1782,39 +1782,33 @@

<sql-query name="getNumberOfSProcessInstanceInvolvingUser">
<return-scalar column="count" type="long"/>
SELECT count(id) as count from (
SELECT p.*
FROM process_instance p
JOIN (
select afi.logicalGroup2 from arch_flownode_instance afi
WHERE afi.kind in ('user', 'manual')
AND ( afi.executedBy = :userId OR afi.executedBySubstitute = :userId )
AND afi.stateId = 2
) humanTask ON (humanTask.logicalGroup2 = p.id)
UNION
SELECT p.*
FROM process_instance p
WHERE p.startedBy = :userId
) p
SELECT COUNT(1) as count
FROM process_instance p
WHERE (
ID IN (
SELECT DISTINCT afi.logicalGroup2
FROM arch_flownode_instance afi
WHERE afi.kind IN ('user', 'manual')
AND (afi.executedBy = :userId OR afi.executedBySubstitute = :userId)
AND afi.stateId = 2)
OR startedBy = :userId
)
</sql-query>


<sql-query name="searchSProcessInstanceInvolvingUser">
<return alias="p" class="org.bonitasoft.engine.core.process.instance.model.SProcessInstance" />
SELECT * from (
SELECT p.*
FROM process_instance p
JOIN (
select afi.logicalGroup2 from arch_flownode_instance afi
WHERE afi.kind in ('user', 'manual')
AND ( afi.executedBy = :userId OR afi.executedBySubstitute = :userId )
AND afi.stateId = 2
) humanTask ON (humanTask.logicalGroup2 = p.id)
UNION
SELECT p.*
FROM process_instance p
WHERE p.startedBy = :userId
) p
SELECT *
FROM process_instance p
WHERE (
ID IN (
SELECT DISTINCT afi.logicalGroup2
FROM arch_flownode_instance afi
WHERE afi.kind IN ('user', 'manual')
AND (afi.executedBy = :userId OR afi.executedBySubstitute = :userId)
AND afi.stateId = 2)
OR startedBy = :userId
)
</sql-query>

<query name="getNumberOfSProcessInstanceInvolvingUsersManagedBy">
Expand Down

0 comments on commit bfd93f9

Please sign in to comment.