[jboss-user] [jBPM] - jbpm 5.3 not complete the task

Jonathan Albornoz do-not-reply at jboss.com
Wed Nov 7 14:27:32 EST 2012

Jonathan Albornoz [https://community.jboss.org/people/betoflint] created the discussion

"jbpm 5.3 not complete the task"

To view the discussion, visit: https://community.jboss.org/message/775433#775433

hi! i have a problem and i want to know if any of you can tell me what to do!

-Windows 7 x64
-jBPM 5.3 Final Release
-Jboss 7.1.1
-H2 Database
-Web application in java
-Jdk  1.6

The application is about the insert of many request of the people…this activate a workflow….just instance when the request is inserted…
Then a person associated with a group has the responsibility to accept the request that in the workflow means that the process is started…then completed…
The problem is that when I insterted an instance of a process… (ksession.startProcess("com.sample.humantask", params) this is saved in h2 in the task table and then I close the connection…when I want complete this task…i make the connection again…complete my task…but don’t start automaticly the next node of my process…I imagine that this happen because I put ksession.dispose after the instance of my process….
How I can save my ksession and the use it to my propose….i will put the code that I use…and sorry for my English…is not native! Thanks…..

This is part of the method that I use to instance my process….

Map<String, Object> parametros = *new* HashMap<String, Object>();
Proceso procMotorWF = *new* Proceso();  
                   procMotorWF.crearConexion();//create the connection

        parametros = procMotorWF.definirSolicitud(usuario_solicitud);
 List<String> grupo = *new* ArrayList<String>();
 List<TaskSummary> listaTareas = procMotorWF.obtenerPosibles(usuario, grupo);
Object object = listaTareas.get(listaTareas.size()-1);
                   TaskSummary ultimaInstancia = (TaskSummary)object;
                   Integer idProceso = *new* Integer((*int*)ultimaInstancia.getId());  
//System.out.println("La ultima instancia generada contiene el id"+ultimaInstancia.getId());


There is the open and close connection

*public* *void* crearConexion(){ //open connection
*if* (kbase == *null*){
*try* {
kbase = +readKnowledgeBase+();
                            } *catch* (Exception e) {
// *TODO* Auto-generated catch block
*if* (ksession==*null*){
ksession = kbase.newStatefulKnowledgeSession();
*if* (logger==*null* && ksession!=*null*){
logger = KnowledgeRuntimeLoggerFactory.+newThreadedFileLogger+(ksession, "test", 1000);
*if*(hornetQHTWorkItemHandler==*null* && ksession!=*null*){
hornetQHTWorkItemHandler = *new* HornetQHTWorkItemHandler(ksession);         
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", hornetQHTWorkItemHandler);         
taskClient = *new* SyncTaskServiceWrapper(*new* AsyncHornetQTaskClient("HumanTaskExample-testClient"));
taskClient.connect("", 5445);
                 SystemEventListenerFactory.+setSystemEventListener+(*new* SystemEventListener());


*public* *void* cerrarConexion(){ //close connection
*try* {

                            } *catch* (Exception e) {
// *TODO* Auto-generated catch block

taskClient = *null*;
hornetQHTWorkItemHandler = *null*;
logger = *null*;


Any idea what i have to do in this case…????
         Very thanks to all of you!! Nad again sorry for my English….
If you need mor information…just tell me!

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121107/c82c8205/attachment-0001.html 

More information about the jboss-user mailing list