0 Replies Latest reply on Oct 31, 2005 7:44 PM by gabriellozano

    strange problem with timer

    gabriellozano

      I have this process definition:

       <node name="CambioEstadoTituloFalso">
       <event type="node-enter">
       <action name="cambiarEstadoTituloInvalido" class="com.edesa.esc.actions.CambiarEstadoTituloInvalido"></action>
       </event>
       <transition name="tr9" to="fork2"></transition>
       </node>
      
       <task-node name="DigitacionRespuestaDocente">
       <task name="digitarRespuestaDocente" swimlane="usuarioActual" blocking="true">
       <controller>
       <variable name="login" />
       <variable name="idTitulo" access="read" />
       <variable name="idDocente" access="read" />
       <variable name="rptaDocente" />
       </controller>
       </task>
       <timer
       name="vencimientoRptaDocenteTimer"
       duedate="15 seconds">
       <action class="com.edesa.esc.actions.VencimientoOficioDocente">
       <swimlane>usuarioActual</swimlane>
       </action>
       </timer>
       <transition name="tr10" to="ErrorDatos"></transition>
       <transition name="tr7" to="CambioEstadoTituloFalso"></transition>
       <transition name="toFork2" to="fork2"></transition>
       </task-node>
       <fork name="fork2">
       <transition name="tr13" to="EnvioOficiosEntesControl"></transition>
       <transition name="tr14" to="RegistroSiTieneEfectosFiscales"></transition>
       </fork>
       <task-node name="EnvioOficiosEntesControl">
       <task name="enviarOficiosEntesControl" blocking="true">
       <controller>
       <variable name="login" />
       <variable name="idTitulo" access="read" />
       <variable name="idDocente" access="read" />
       </controller>
       </task>
       <transition name="tr11" to="join1"></transition>
       </task-node>
       <task-node name="RegistroSiTieneEfectosFiscales">
       <task name="registrarSiTieneEfectosFiscales" swimlane="usuarioActual" blocking="true">
       <controller>
       <variable name="login" />
       <variable name="idTitulo" access="read" />
       <variable name="idDocente" access="read" />
       <variable name="efectosFiscales" />
       </controller>
       </task>
       <transition name="tr12" to="TieneEfectosFiscales"></transition>
       </task-node>
      

      the execute method of the action class of the vencimientoRptaDocenteTimer is this:

       public void execute(ExecutionContext context) throws Exception {
       Long titulo = (Long) context.getContextInstance().getVariable("idTitulo");
       TituloDocente td = (TituloDocente) BaseService.load(TituloDocente.class, titulo);
       log.debug("*** Vencimiento del Oficio enviado al docente para el titulo " + titulo +
       " de la institucion " + td.getNombreInstitucion());
      
       /* ** Envia el proceso al nodo "CambiarEstadoTituloFalso" (NODO 10) ** */
       Token pathActual = context.getToken();
       log.debug("*** TOKEN ACTUAL: " + pathActual.toString());
      
       TaskNode node = (TaskNode) pathActual.getNode();
       log.debug("*** NODO ACTUAL: " + node.getName());
      
       // Cancela las tareas pendientes en el nodo y envia hacia el NODO 10:
       String login = (String) context.getContextInstance().getVariable("login");
       TaskInstance task = JbpmService.getTaskInstance(login, pathActual.getProcessInstance().getId(), "digitarRespuestaDocente");
       task.end("tr7");
      }
       public void execute(ExecutionContext context) throws Exception {
       Long titulo = (Long) context.getContextInstance().getVariable("idTitulo");
       TituloDocente td = (TituloDocente) BaseService.load(TituloDocente.class, titulo);
       log.debug("*** Vencimiento del Oficio enviado al docente para el titulo " + titulo +
       " de la institucion " + td.getNombreInstitucion());
      
       /* ** Envia el proceso al nodo "CambiarEstadoTituloFalso" (NODO 10) ** */
       Token pathActual = context.getToken();
       log.debug("*** TOKEN ACTUAL: " + pathActual.toString());
      
       TaskNode node = (TaskNode) pathActual.getNode();
       log.debug("*** NODO ACTUAL: " + node.getName());
      
       // Cancela las tareas pendientes en el nodo y envia hacia el NODO 10:
       String login = (String) context.getContextInstance().getVariable("login");
       TaskInstance task = JbpmService.getTaskInstance(login, pathActual.getProcessInstance().getId(), "digitarRespuestaDocente");
       task.end("tr7");
      


      so, when the timer executes (vencimientoRptaDocenteTimer) creates the task digitarRespuestaDocente and ends it. It is signaling so it is supposed to get the token to the CambioEstadoTituloFalso node, and it does it. CambioEstadoTituloFalso should take the token to the fork2 node, and it should launch 2 children tokens and get the first child token to the EnvioOficiosEntesControl node and the other to the RegistroSiTieneEfectosFiscales node, but it does not. So, when I see the db, only the root token appears, and it points to the CambioEstadoTituloFalso node. But what is very strange is the log:


      2005-10-31 18:08:19,018 DEBUG [org.jbpm.graph.def.GraphElement] event 'transition' on 'Transition(tr7)' for 'Token(/)'
      2005-10-31 18:08:19,154 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-enter' on 'Node(CambioEstadoTituloFalso)' for 'Token(/)'
      2005-10-31 18:08:19,154 INFO [STDOUT] Hibernate: select
      2005-10-31 18:08:20,263 DEBUG [org.jbpm.graph.def.GraphElement] executing action 'action[cambiarEstadoTituloInvalido]'
      2005-10-31 18:08:22,647 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-leave' on 'Node(CambioEstadoTituloFalso)' for 'Token(/)'
      2005-10-31 18:08:22,647 DEBUG [org.jbpm.graph.def.GraphElement] event 'transition' on 'Transition(tr9)' for 'Token(/)'
      2005-10-31 18:08:22,784 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-enter' on 'Fork(fork2)' for 'Token(/)'
      2005-10-31 18:08:23,999 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-leave' on 'Fork(fork2)' for 'Token(/tr13)'
      2005-10-31 18:08:23,999 DEBUG [org.jbpm.graph.def.GraphElement] event 'transition' on 'Transition(tr13)' for 'Token(/tr13)'
      2005-10-31 18:08:24,136 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-enter' on 'TaskNode(EnvioOficiosEntesControl)' for 'Token(/tr13)'
      2005-10-31 18:08:25,396 DEBUG [org.jbpm.graph.def.GraphElement] event 'task-assign' on 'Task(enviarOficiosEntesControl)' for 'Token(/tr13)'
      2005-10-31 18:08:25,669 DEBUG [org.jbpm.graph.def.GraphElement] event 'task-create' on 'Task(enviarOficiosEntesControl)' for 'Token(/tr13)'
      2005-10-31 18:08:25,669 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-leave' on 'Fork(fork2)' for 'Token(/tr14)'
      2005-10-31 18:08:25,669 DEBUG [org.jbpm.graph.def.GraphElement] event 'transition' on 'Transition(tr14)' for 'Token(/tr14)'
      2005-10-31 18:08:25,806 DEBUG [org.jbpm.graph.def.GraphElement] event 'node-enter' on 'TaskNode(RegistroSiTieneEfectosFiscales)' for 'Token(/tr14)'
      2005-10-31 18:08:26,778 DEBUG [org.jbpm.graph.def.GraphElement] event 'task-assign' on 'Task(registrarSiTieneEfectosFiscales)' for 'Token(/tr14)'
      2005-10-31 18:08:26,915 DEBUG [org.jbpm.graph.def.GraphElement] event 'task-create' on 'Task(registrarSiTieneEfectosFiscales)' for 'Token(/tr14)'
      2005-10-31 18:08:26,915 DEBUG [org.jbpm.graph.def.GraphElement] event 'after-signal' on 'TaskNode(DigitacionRespuestaDocente)' for 'Token(/)'
      2005-10-31 18:08:27,689 INFO [STDOUT] Hibernate: delete from JBPM_TIMER where NAME_=? and TOKEN_=?
      2005-10-31 18:08:27,735 DEBUG [org.jbpm.scheduler.impl.SchedulerThread] deleting timer 'timer(vencimientoRptaDocenteTimer,com.edesa.esc.actions.VencimientoOficioDocente,18:07:03,701)'
      2005-10-31 18:08:27,735 INFO [STDOUT] Hibernate: delete from JBPM_TIMER where ID_=?
      2005-10-31 18:08:27,796 WARN [org.jbpm.db.JbpmSession] can't pop current session: are you calling JbpmSession.close() multiple times ?
      
      


      it seems that it is doing what I wanted, but it is not. Could it be because of the WARN in the end? what could it be?