1 Reply Latest reply on Jun 27, 2017 9:29 AM by Abhijit Humbe

    Unable to complete human task and move on to the next task

    Debarshi Bhattacharya Newbie

      I have to complete two human tasks to finish my workflow.

       

      Executing my task with the following code :

       

      public void executeTask(String username, String password) {

        Map<String, Object> params = new HashMap<String, Object>();

        params.put("scorepercent", "01");

        List<TaskSummary> taskList;

        TaskService taskService = engine.getTaskService();

        taskList = taskService.getTasksOwned(username, password);

        int sl = 1;

        for(TaskSummary ts: taskList) {

        System.out.println("Task "+ sl++ +" :");

        System.out.println("Task Name : " + ts.getName());

        System.out.println("Task ID : " + ts.getId());

        System.out.println("Task Status : " + ts.getStatus());

        if(Status.Reserved.equals(ts.getStatus()))

        {

        System.out.println("Inside release task");

        taskService.release(ts.getId(), username);

        System.out.println("Task released");

        taskService.claim(ts.getId(), username);

        System.out.println("Task claimed");

        taskService.start(ts.getId(), username);

        System.out.println("Task started");

        taskService.complete(ts.getId(), username, params);

        System.out.println("Task completed");

        }

        }

        }

       

       

      After executing getting the following error :

      Task released

      Task claimed

      Task started

      Exception in thread "main" org.kie.remote.client.api.exception.RemoteCommunicationException: Unable to send HTTP POST request

        at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:387)

        at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeCommand(AbstractRemoteCommandObject.java:160)

        at org.kie.services.client.api.command.TaskServiceClientCommandObject.complete(TaskServiceClientCommandObject.java:301)

        at org.jbpm.JbpmUtil.executeTask(JbpmUtil.java:97)

        at org.jbpm.ProcessMain.main(ProcessMain.java:19)

      Caused by: org.kie.remote.common.rest.KieRemoteHttpRequestException: Error occurred when trying to retrieve response code

        at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemoteHttpRequest.java:1331)

        at org.kie.remote.common.rest.KieRemoteHttpRequest.post(KieRemoteHttpRequest.java:719)

        at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:383)

        ... 4 more

      Caused by: java.net.SocketTimeoutException: Read timed out

       

       

      Note human task is not getting completed. Please help me to solve this. Also please suggest how to call the next human task.

      Both the tasks are assigned to bpmsAdmin user.

       

      Any help would be really very helpful.