Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 871899

Summary: Creation of getTasksByProcessInstanceIdStatus and getTasksByProcessInstanceIdStatusTaskName as public API
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Alessandro Lazarotti <alazarot>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: CLOSED UPSTREAM QA Contact: Marek Baluch <mbaluch>
Severity: high Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: alazarot
Target Milestone: ER4   
Target Release: BRMS 5.3.1 GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, there were no public API methods available to get tasks based on the process instance ID. This prevented users from accessing lists of tasks associated with any give process instance. The API methods getTasksByProcessInstanceIdStatus and getTasksByProcessInstanceIdStatusTaskName have been created and can be used to return tasks by process instance ID and task status, or by process instance ID, task name and task status. This ensures tasks can be returned for a given process instance.
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:21:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
unit test attached none

Description Alessandro Lazarotti 2012-10-31 16:33:36 UTC
Description of problem:

The most of public queries for tasks require the use of userId, which is not applicable in some cases where processInstance id it the main targeted. A non implementation of the new suggested queries impact in the extra round trips to database, which can be expensive if several processInstances are running in the same time.

How reproducible:
Attached jUnit test for this use case

Comment 2 Alessandro Lazarotti 2012-10-31 17:07:05 UTC
Created attachment 636232 [details]
unit test attached

Comment 3 Alessandro Lazarotti 2012-11-01 03:43:39 UTC
Pull request: https://github.com/droolsjbpm/jbpm/pull/141

Comment 5 Maciej Swiderski 2012-11-02 11:40:07 UTC
pull request merged into 5.2.x and master, thanks Alessandro!

Comment 6 Jiri Svitak 2012-11-15 14:04:52 UTC
Verified in BRMS 5.3.1 ER1, but only for Hibernate 3, there is a Hibernate 4 problem with the following query:

1    15/11 14:56:41,088[main] ERROR hibernate.internal.SessionFactoryImpl.<init>  - HHH000177: Error in named query: TasksByStatusByProcessIdByTaskName
org.hibernate.QueryException: could not resolve property: shortText of: org.jbpm.task.I18NText [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, actualOwner, createdBy, t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime, t.taskData.processId, t.taskData.processSessionId) from org.jbpm.task.Task t left join t.taskData.actualOwner as actualOwner left join t.taskData.createdBy as createdBy left join t.subjects as subject left join t.descriptions as description left join t.names as name where t.archived = 0 and t.taskData.processInstanceId = :processInstanceId and name.shortText = :taskName 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 (:status) and t.taskData.expirationTime is null]

However this problem is tracked by different JPA2/Hibernate4/EAP6 related Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=874104. Because of this I am setting this Bugzilla to VERIFIED.

Comment 7 Jiri Svitak 2012-11-15 16:58:44 UTC
Please ignore my concerns about JPA2 in my previous comment. This new feature works both with Hibernate 3 and 4.

Comment 15 Red Hat Bugzilla 2025-02-10 03:21:02 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.