Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-1994

UnsupportedOperationException when TaskService.getTasksAssignedAsPotentialOwner(String userId, List<String> groupIds, String language, int firstResult, int maxResults)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 6.0.1
    • Business Central
    • None

      Description of problem:

      When you call TaskService.getTasksAssignedAsPotentialOwner(String userId, List<String> groupIds, String language, int firstResult, int maxResults) via REST API, it throws java.lang.UnsupportedOperationException.

      It is because org.kie.services.client.api.command.AcceptedCommands doesn't list GetTaskAssignedAsPotentialOwnerPagingCommand().

      Steps to Reproduce:
      1. Create ksession/taskService from RemoteRestRuntimeFactory.
      2. Call TaskService.getTasksAssignedAsPotentialOwner(String userId, List<String> groupIds, String language, int firstResult, int maxResults)


      RemoteRestRuntimeFactory restSessionFactory = new RemoteRestRuntimeFactory(deploymentId, appUrl, user, password);
      RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine();

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

      ProcessInstance processInstance = ksession.startProcess("project1.helloProcess", null);
      List<String> groupIds = new ArrayList<String>();
      groupIds.add("IT");

      List<TaskSummary> tasksAssignedAsPotentialOwner = taskService.getTasksAssignedAsPotentialOwner("john",
      groupIds, "en-UK", 1, 10);

      Actual results:


      Exception in thread "main" java.lang.UnsupportedOperationException: The .getTasksAssignedAsPotentialOwner(..) method is not supported on the remote api.
      at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:95)
      at org.jbpm.services.task.impl.command.CommandBasedTaskService.getTasksAssignedAsPotentialOwner(CommandBasedTaskService.java:416)
      at com.sample.SimpleRestClientFail.main(SimpleRestClientFail.java:44)

      Expected results:

      Returns taskSummary list.

              marco.rietveld Marco Rietveld (Inactive)
              rhn-support-tkobayas Toshiya Kobayashi
              Ivo Bek Ivo Bek
              Ivo Bek Ivo Bek
              Alessandro Lazarotti, bahram zaeri (Inactive), Kris Verlaenen, Marco Rietveld (Inactive), Rajesh Rajasekaran
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: