Red Hat Bugzilla – Bug 1200628
Add taskService.addContent() for Remote API
Last modified: 2018-01-30 23:40:04 EST
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.
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.).
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.
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).
addOutputContent() looks good for the BZ's expectation. Thanks Marco!
Verified on BPMS 6.2.0 ER3