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

Bug 1200628

Summary: Add taskService.addContent() for Remote API
Product: [Retired] JBoss BPMS Platform 6 Reporter: Toshiya Kobayashi <tkobayas>
Component: Business CentralAssignee: Shelly McGowan <smcgowan>
Status: CLOSED EOL QA Contact: Lukáš Petrovický <lpetrovi>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.3CC: ksuta, kverlaen
Target Milestone: ER1   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:07:43 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 Toshiya Kobayashi 2015-03-11 02:58:58 UTC
Description of problem:

Please add addContent(long taskId, Map<String, Object> params) method to Remote API taskService.


Steps to Reproduce:

RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine();
TaskService taskService = engine.getTaskService();
Map<String, Object> params = new HashMap<String, Object>();
params.put("param1", "01");
((InternalTaskService)taskService).addContent(taskId, params);

Actual results:

java.lang.UnsupportedOperationException: The .addContent(..) method is not supported on the remote api.
	at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:103)
	at org.jbpm.services.task.impl.command.CommandBasedTaskService.addContent(CommandBasedTaskService.java:547)
	at com.sample.SimpleRestTest.testRest(SimpleRestTest.java:63)

Expected results:

Executed without Exception.

Comment 1 Toshiya Kobayashi 2015-03-11 06:04:17 UTC
This BZ request is

- long addContent(long taskId, Map<String, Object> params);

but

- long addContent(long taskId, Content content);

is also good to have (not mandatory for this BZ.).

Comment 2 Marco Rietveld 2015-08-04 11:25:58 UTC
Fixed. Commits: 

6.3.x: 
https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/ff4e1b20
https://github.com/droolsjbpm/droolsjbpm-integration/commit/6790e8ef
https://github.com/droolsjbpm/jbpm/commit/b6949dfd

These commits are also available on master (6.4): see the chery-pick links in the above github links.

Comment 3 Marco Rietveld 2015-08-04 11:26:08 UTC
Toshiya, 

I've only added the following operations: 

 RemoteApiResponse<Long> resp = remoteTaskService.addOutputContent(taskId, contentMap);
 RemoteApiResponse<Map<String, Object>> mapResp = remoteTaskService.getOutputContentMap(taskId);

See 

https://github.com/droolsjbpm/droolsjbpm-integration/blob/6.3.x/kie-remote/kie-remote-client/src/main/java/org/kie/remote/client/api/RemoteTaskService.java#L43-L45

You can find an example of how to use these operations here: 

https://github.com/droolsjbpm/kie-tests/blob/26a001e199149dab41e86cc3580b8a3143896910/remote-kie-tests/kie-wb-tests/kie-wb-tests-base/src/main/java/org/kie/tests/wb/base/methods/KieWbRestIntegrationTestMethods.java#L1261-L1293

I'm discussing how to best add a "pure" addContent method (something like addcontent(long taskId, Object content) or addContent(long taskId, Serializable object)) with Maciej and Kris. I hope to add it soon (but not for product 6.2, unfortunately).

Comment 4 Toshiya Kobayashi 2015-08-05 00:59:14 UTC
addOutputContent() looks good for the BZ's expectation.

Thanks Marco!

Comment 5 Tomas Livora 2015-10-01 08:40:45 UTC
Verified on BPMS 6.2.0 ER3