Bug 1330200 - Not able to list tasks assigned to group through Remote API's
Summary: Not able to list tasks assigned to group through Remote API's
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Shelly McGowan
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks: 1333628
TreeView+ depends on / blocked
 
Reported: 2016-04-25 15:21 UTC by Abhijit humbe
Modified: 2020-03-27 19:40 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 1333628 (view as bug list)
Environment:
Last Closed: 2020-03-27 19:40:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Reproducer and Log files (19.27 KB, application/zip)
2016-04-25 15:21 UTC, Abhijit humbe
no flags Details
ProposedWorkAround (1.30 KB, text/plain)
2016-04-28 04:09 UTC, William Antônio
no flags Details

Description Abhijit humbe 2016-04-25 15:21:35 UTC
Created attachment 1150535 [details]
Reproducer and Log files

Description of problem:

I am trying to with below API's to list the HumanTask assigned to group through Remote REST API's but it fails with exception:

~~~
Unable to execute GetTaskAssignedAsPotentialOwnerCommand/0: org.kie.remote.services.rest.exception.KieRemoteRestOperationException: Organizational entity already exists with [UserImpl:'HR'] id, please check that there is no group and user with same id
~~~

Code:
=====================
RuntimeEngine engine = RemoteRuntimeEngineFactory.newRestBuilder()
		.addUrl(url).addUserName(userName).addPassword(passWord)
		.addDeploymentId(deploymentId).build();

KieSession ksession = engine.getKieSession();
TaskService taskService = engine.getTaskService();
	

ProcessInstance processInstance = ksession.startProcess("project1.TestProcess");
tasklist = taskService.getTasksAssignedAsPotentialOwner("HR","en-UK");

=====================


Version-Release number of selected component (if applicable):
BPMS 6.2.2

How reproducible:


Steps to Reproduce:
1. Start server(BPMS 6.2.2) with -Dorg.kie.task.insecure=true and deploy attached kajr.
2. Apply one-off patch attached to BZ-1325945 and use -Dorg.kie.task.insecure=true option in client side and server side.
3. Try to list task using Remote REST API

Actual results:
Not able to list User Task assigned to group through Remote REST API

Expected results:
User should be able to list task assigned to group through Remote REST API

Additional info:

Comment 2 William Antônio 2016-04-28 04:09:05 UTC
Created attachment 1151713 [details]
ProposedWorkAround

An workaround for this bug.

Comment 3 William Antônio 2016-04-28 04:10:08 UTC
I made a few tests and I found that this is indeed a bug, but not a bug with the client side patch, but with the task.insecure parameter implementation and with the core of the remote rest client API itself. The client patch only exposed this bug by allowing us to send requests to retrieve potential owners for a group, before it it was not allowed.

The good news is that I have a work around! The client java API will always send a command to the server, the command used to get tasks by owner is the GetTaskAssignedAsPotentialOwnerCommand. The issue is that it uses the user id to set the potential owner when we should be using the target entity id. So the following should work to retrieve the tasks for a group (see the attached test class)


Note You need to log in before you can comment on or make changes to this bug.