JBoss Community

Jbpm5.4 how to get task list from task server

created by xin sun in jBPM - View the full discussion

HI guys, I am new to jbpm. I am using jbpm 5.4 following the jbpm-installer and I am thinking how to integrate the process system into my web application. One step is I wrote below code to query the task list for a user with userId.

The taskservice I used is the default one installed and deployed by the installer: jbpm-human-task-war.war, and I did no change any configuration file after the installation. I can query the task list from the eclipse Human task view successfully.  But when I ran below code to query the task list for krisv(I am sure that I can get krisv's task from the Huamn task view), it always failed due to timeout, or just return 0:

//----------------------------------------------------------------------------------------------------------

import java.util.List;

 

import org.jbpm.task.AsyncTaskService;

import org.jbpm.task.service.hornetq.AsyncHornetQTaskClient;

import org.jbpm.task.service.responsehandlers.BlockingTaskSummaryResponseHandler;

 

public class TestTaskClient {

 

    public static void main(String[] args) {

        AsyncTaskService  client = new AsyncHornetQTaskClient();

        client.connect("127.0.0.1", 5153);

        System.out.println("Good");

        BlockingTaskSummaryResponseHandler taskSummaryHandler = new BlockingTaskSummaryResponseHandler();

        client.getTasksAssignedAsPotentialOwner("krisv", "en-UK", taskSummaryHandler);

       // I also tried client.getTasksAssignedAsPotentialOwner("krisv", null, taskSummaryHandler); but still failed;

        List tasks = taskSummaryHandler.getResults();

    }

}

//----------------------------------------------------------------------------------------------------------

 

Anyone tell me why? Thanks in advance.

Reply to this message by going to Community

Start a new discussion in jBPM at Community