Bug 1048346
Summary: | Add lookup of WorkItem from WorkItemInfo id or List<WorkItem> from ProcessInstance id | ||
---|---|---|---|
Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Adam Baxter <abaxter> |
Component: | jBPM Core | Assignee: | Kris Verlaenen <kverlaen> |
Status: | CLOSED EOL | QA Contact: | Radovan Synek <rsynek> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 6.0.0 | CC: | abaxter, lpetrovi, rrajasek |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-03-27 19:35:59 UTC | Type: | Feature Request |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Adam Baxter
2014-01-03 19:13:31 UTC
In particular, we are running the following queries: 1) Query query = entityManager.createQuery("from WorkItemInfo wii where wii.workItemId = :workItemId"); query.setParameter("workItemId", id); WorkItemInfo info = (WorkItemInfo)query.getSingleResult(); 2) final Long pendingStatus = new Long(WorkItem.PENDING); Query query = entityManager.createQuery("from WorkItemInfo wii where wii.processInstanceId = :processInstanceId and wii.state = :state"); query.setParameter("processInstanceId", processInstanceId); query.setParameter("state", pendingStatus); List<WorkItemInfo> infos = (List)query.getResultList(); As this is a new feature I'm setting severity to low. Adam, could you elaborate why you would need access to the WorkItemInfo object? This is considered an internal persistence Object and should only be accessed with caution (similar to for example ProcessInstanceInfo). Note that you could get a WorkItem using: ((org.drools.core.process.instance.WorkItemManager) ksession.getWorkItemManager()).getWorkItem(id) Hi Kris, Our goal is to provide the WorkItem when the only information we've been provided is the WorkItem Id. In this code we do not know the ProcessInstance Id at the start. We need that to get the ksession. Our code looks like: 1) Get WorkItemInfo matching the provided WorkItem id. 2) Get the ProcessInstance Id from the WorkItemInfo 3) Get the KieSession given the ProcessInstance Id 4) Get the WorkItemManager from the KieSession 5) return the WorkItem from the WorkItemManager using the originally provided id |