<!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;">
Urgent, Mina Handler is not working
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/betoflint">Jonathan Albornoz</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/789706#789706">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi, i have configure my jbpm 53 with jboss 7.0.2 and the persistence is with oracle, all work fine in the console, but i have to make it work with the api.</p><p>I have the next code to start my proces and complete it! but when the task is complete, the handler not work, and dont reserve the next node.</p><p>I imagine that my handler is not used correctly. Any idea what is my problem in the code?? i use jbpm helper, that is configures in the jbpm-test in the runtime folder.</p><p>i dont know if mina is correctly used, neither if i must use hornetq, or anything else!!</p><p>I tried with jbpm 5.4 and i have the same problem...any please...this is very urgent!!</p><p>the files that i have is attached!! thanks!! please!!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>package com.sample;</p><p>import java.util.List;</p><p>import javax.persistence.EntityManagerFactory;</p><p>import javax.persistence.Persistence;</p><p>import org.drools.KnowledgeBase;</p><p>import org.drools.SystemEventListenerFactory;</p><p>import org.drools.builder.KnowledgeBuilder;</p><p>import org.drools.builder.KnowledgeBuilderFactory;</p><p>import org.drools.builder.ResourceType;</p><p>import org.drools.io.ResourceFactory;</p><p>import org.drools.logger.KnowledgeRuntimeLogger;</p><p>import org.drools.logger.KnowledgeRuntimeLoggerFactory;</p><p>import org.drools.runtime.StatefulKnowledgeSession;</p><p>import org.jbpm.process.workitem.wsht.HornetQHTWorkItemHandler;</p><p>import org.jbpm.task.TaskService;</p><p>import org.jbpm.task.query.TaskSummary;</p><p>import org.jbpm.task.service.SyncTaskServiceWrapper;</p><p>import org.jbpm.task.service.TaskClient;</p><p>import org.jbpm.task.service.hornetq.AsyncHornetQTaskClient;</p><p>import org.jbpm.task.service.mina.MinaTaskClientConnector;</p><p>import org.jbpm.task.service.mina.MinaTaskClientHandler;</p><p>import org.jbpm.task.service.mina.MinaTaskServer;</p><p>import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;</p><p>import org.jbpm.task.service.responsehandlers.BlockingTaskSummaryResponseHandler;</p><p>import org.jbpm.test.JBPMHelper;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public class ProcessMain2 {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>          public static final void main(String[] args) throws Exception {</p><p>                    startUp();</p><p>                    // load up the knowledge base</p><p>                    KnowledgeBase kbase = readKnowledgeBase();</p><p>                    StatefulKnowledgeSession ksession = JBPMHelper.newStatefulKnowledgeSession(kbase);</p><p>                    // start a new process instance</p><p>                    ksession.startProcess("com.sample.bpmn.hello");</p><p>                    //ksession.dispose();</p><p>                    System.out.println("Process started ...");</p><p>  </p><p>                    //Genero la conexion para acceder a las tareas usando TASK</p><p>                    TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1",</p><p>                    new  MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));</p><p>                    client.connect("127.0.0.1", 9123);</p><p>  //capturo las tareas reservadas</p><p>                    BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();</p><p>                    client.getTasksAssignedAsPotentialOwner("luis", "en-UK", taskSummaryResponseHandler);</p><p>                    List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();</p><p>                    for (TaskSummary task: tasks) {</p><p>                              System.out.println(task.getId() + " " + task.getName() + " " + task.getStatus());</p><p>                    }</p><p>                    //para todas las tareas incluyendo las terminadas</p><p>                    taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();</p><p>                    System.out.println("***************************************************");</p><p>                    client.getTasksOwned("luis", "en-UK", taskSummaryResponseHandler);</p><p>                    tasks = taskSummaryResponseHandler.getResults();</p><p>                    for (TaskSummary task: tasks) {</p><p>                              System.out.println(task.getId() + " " + task.getName() + " " + task.getStatus());</p><p>                    }</p><p>  //para iniciar una tarea</p><p>                    BlockingTaskOperationResponseHandler responseHandler =  new BlockingTaskOperationResponseHandler();</p><p>                    client.start( 18, "luis", responseHandler );</p><p>                    responseHandler.waitTillDone(1000); </p><p>                    //para completar una tarea</p><p>                    responseHandler = new BlockingTaskOperationResponseHandler();</p><p>                    client.complete( 18, "luis", null , responseHandler);</p><p>                    responseHandler.waitTillDone(1000);</p><p>                    ksession.dispose();</p><p>                    System.exit(0);</p><p>          }</p><p>  private static KnowledgeBase readKnowledgeBase() throws Exception {</p><p>                    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();</p><p>                    kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"), ResourceType.BPMN2);</p><p>                    return kbuilder.newKnowledgeBase();</p><p>          }</p><p>  </p><p>          private static void startUp() {</p><p>                    JBPMHelper.startH2Server();</p><p>                    JBPMHelper.setupDataSource();</p><p>  JBPMHelper.startTaskService();</p><p>          }</p><p>     </p><p>}</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/789706#789706">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>