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

Bug 1181455

Summary: [Remote API] List of potentialOwners is always null
Product: [Retired] JBoss BPMS Platform 6 Reporter: Anton Giertli <agiertli>
Component: DocumentationAssignee: Vikram Goyal <vigoyal>
Status: CLOSED NEXTRELEASE QA Contact: Ivo Bek <ibek>
Severity: high Docs Contact: Vikram Goyal <vigoyal>
Priority: high    
Version: 6.0.3CC: agiertli, brms-docs, kverlaen, mswiders, viyengar, wsiqueir
Target Milestone: CR2   
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-06 03:32:00 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
[0] kjar + client none

Description Anton Giertli 2015-01-13 08:32:08 UTC
Created attachment 979508 [details]
[0]  kjar + client

Description of problem:
It is not possible to retrieve Potential Owners of the Human Task using native remote client.

Version-Release number of selected component (if applicable):
bpm 6.0.3+rp1 applied

How reproducible:
always

Steps to Reproduce:
1. Deploy attached kjar into business-central, it includes process with human tasks which has following expression under actor field: "anton1,anton2"
2. run client
3. The List of potential owners is null - in UI, this list is correctly populated

You may need to alter the Users (either or server or client side, or both..)
I am using "anton1" and "anton2"
Actual results:
The list of potential owners retrieved through remote client is null

Expected results:
The list of potential owners retrieved through remote client contains potential owners :)

Additional info:

Comment 2 Kris Verlaenen 2015-01-13 14:08:06 UTC
Marco, is there a reason why potential owners are not populated in the remote jaxb tasks?  It seems to be reported against 6.0.x so maybe already fixed in 6.1.x?

Comment 3 Anton Giertli 2015-01-15 07:41:22 UTC
Additionally,

getActualOwner
getCreatedBy

always returns null no matter what.

Comment 4 Maciej Swiderski 2015-01-19 16:26:33 UTC
I'd prefer to not implement this on the level of query - and be returned as part of TaskSummary as it will make the query operation rather heavy. Collecting all potential owners for all found tasks might become a performance issue. Thus I would like to suggest following:
- do the query first
- for whatever task you need details get them via getTaskById method which will return potential owners as well.

This way we stay in good shape when it comes to performance and still provide all required information. Moreover this is exactly the same way we do on UI side. Display the details only for individual tasks on demand.

When it comes to ActualOwner and CreatedBy they do provide valid entries but in 6.1 you should rather rely on getActualOwnerId and getCreatedById which will return directly the id of the actor rather than User object instance.

So my vote is to set it to modified to retest the actual owner and created by functionality and do not change code base for loading more data at query time.

Comment 5 Anton Giertli 2015-01-20 14:09:51 UTC
Maciej,

I have tested the following:

for (TaskSummary sum : list) {
System.out.println("task pot own:"+sum.getPotentialOwners()); // this is null

Task task = taskService.getTaskById(sum.getId());
List<OrganizationalEntity> org =  task.getPeopleAssignments().getPotentialOwners();
				
for (OrganizationalEntity ent: org) {
				
System.out.println("org:"+ent.getId()); //expected result
}
				
}

taskService.start(list.get(0).getId(), "anton1");
		
		System.out.println("ActOwn:"+taskService.getTaskById(list.get(0).getId()).getTaskData().getActualOwner().getId()); //expected
System.out.println("ActOwn1"+list.get(0).getActualOwner()); //null

I think this is what you have had in mind? If so, I am pretty satisfied with the behavior. The only thing which needs to be adjusted is documentation, so the customers know that it is expected that calling getPotentialOwners on TaskSummary remotely will give you null result and you need to fetch the Task object in order to get this information.

Anton.

Comment 6 Maciej Swiderski 2015-01-21 12:12:41 UTC
yes, that is exactly what I had in mind. Good then I'll transfer this to docs team as there won't be any code changes for that.

@Vikram, could you please add that to the docs - conclusion from comment 5?

Comment 9 Vikram Goyal 2015-02-04 06:36:38 UTC
I have documented this in the new Development Guide here [1] as a note.

Please verify if the note accurately describes the resolution for this issue.

Moving this to ON_QA for a 6.1 release (and NOT for 6.0 async release as it contains methods that are in 6.1 - getActualOwnerById and getCreatedById())

[1] http://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_JBoss_BPM_Suite/6.1/html-single/Development_Guide/index.html#The_REST_Remote_Java_RuntimeEngine_Factory

Comment 11 Vikram Goyal 2015-02-09 13:09:45 UTC
Thanks Ivo. I have shortened the text at the start. This can now be verified here [1].

Moving back to ON_QA.

[1] http://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_JBoss_BPM_Suite/6.1/html-single/Development_Guide/index.html#The_REST_Remote_Java_RuntimeEngine_Factory