<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Getting task summaries
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/garethed">Gareth Edwards</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/784314#784314">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p style="font-size: 11px; font-family: Monaco;">Hello,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="font-size: 11px; font-family: Monaco;">I'm writing a Rest API to manage user tasks.</p><p style="font-size: 11px; font-family: Monaco;">The code below is some test code to return a list of task summaries based on a user.</p><p style="font-size: 11px; font-family: Monaco;">This works the first time and the correct tasks are returned.</p><p style="font-size: 11px; font-family: Monaco;">If I then claim a task for exapmple, It will still show up in the list if the code below is called.</p><p style="font-size: 11px; font-family: Monaco;">If I restart JBoss inbetween then the list is correct.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="font-size: 11px; font-family: Monaco;">jBoss is running on a server on the LAN and Tomcat is running the REST API locally.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="font-size: 11px; font-family: Monaco;">It's like the data returned is being cached.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="font-size: 11px; font-family: Monaco;">Any help would be appriciated.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="font-size: 11px; font-family: Monaco;">Thanks.</p><p style="font-size: 11px; font-family: Monaco;">&#160; </p><p style="font-size: 11px; font-family: Monaco;"><span style="color: #931a68;">public</span> TaskSummaryJson getPotentialTasks(String user, String locale){</p><p style="font-size: 11px; font-family: Monaco;">&#160; </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;TaskClient client = <span style="color: #931a68;">new</span> TaskClient(<span style="color: #931a68;">new</span> HornetQTaskClientConnector(<span style="color: #3933ff;">"client 1"</span>, <span style="color: #931a68;">new</span> HornetQTaskClientHandler(SystemEventListenerFactory.getSystemEventListener()))); </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; client.connect(<span style="color: #3933ff;">"10.0.0.101"</span>, 5153);</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = <span style="color: #931a68;">new</span> BlockingTaskSummaryResponseHandler();</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; client.getTasksAssignedAsPotentialOwner(user, locale, taskSummaryResponseHandler);</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160; </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; List&lt;TaskSummary&gt; tasks = taskSummaryResponseHandler.getResults();</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; TaskSummaryJson summary&#160; = <span style="color: #931a68;">new</span> TaskSummaryJson();</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; summary.setListObjects(tasks);</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; summary.setSuccess(<span style="color: #931a68;">true</span>);</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; summary.setMessage(<span style="color: #3933ff;">"ok"</span>);</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #931a68;">try</span> {</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;client.disconnect();</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} <span style="color: #931a68;">catch</span> (Exception e) {</p><p style="font-size: 11px; font-family: Monaco; color: #4e9072;"><span style="color: #000000;">&#160; </span>// <span style="color: #91afcb;">TODO</span> Auto-generated catch block</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;e.printStackTrace();</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} </p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: #931a68;">return</span> summary;</p><p style="font-size: 11px; font-family: Monaco;">&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/784314#784314">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>