JBoss Community

Getting task summaries

created by Gareth Edwards in jBPM - View the full discussion

Hello,

 

I'm writing a Rest API to manage user tasks.

The code below is some test code to return a list of task summaries based on a user.

This works the first time and the correct tasks are returned.

If I then claim a task for exapmple, It will still show up in the list if the code below is called.

If I restart JBoss inbetween then the list is correct.

 

jBoss is running on a server on the LAN and Tomcat is running the REST API locally.

 

It's like the data returned is being cached.

 

Any help would be appriciated.

 

Thanks.

 

public TaskSummaryJson getPotentialTasks(String user, String locale){

 

                    TaskClient client = new TaskClient(new HornetQTaskClientConnector("client 1", new HornetQTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

        client.connect("10.0.0.101", 5153);

       

       

        BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();

       

        client.getTasksAssignedAsPotentialOwner(user, locale, taskSummaryResponseHandler);

       

  

        List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();

       

        TaskSummaryJson summary  = new TaskSummaryJson();

        summary.setListObjects(tasks);

        summary.setSuccess(true);

        summary.setMessage("ok");

       

 

        try {

                              client.disconnect();

                    } catch (Exception e) {

  // TODO Auto-generated catch block

                              e.printStackTrace();

                    }

                    return summary;

          }

Reply to this message by going to Community

Start a new discussion in jBPM at Community