Problema con timer en workflow

cancel
Showing results for 
Search instead for 
Did you mean: 
fstnboy
Active Member

Problema con timer en workflow

Buenas,

Estoy creando un workflow que publique los cambios de un sandbox de usuario a un servidor tipo TEST siempre que haya uno libre, en caso de que no haya ninguno liberado, se espera un tiempo y se vuelve a mirar si esta libre.


<state name="checkserveravailability">
      <timer name="repeaterTimer" duedate="10 seconds" transition="fire">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <script>
            logger.log("Executing the timer!");
               </script>
      </action>
      </timer>
      <transition name="fire" to="isserveravailable">
         <exception-handler>
         </exception-handler>
      </transition>
   </state>

    <decision name="isserveravailable">
       <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("Checking server availability!");
                </script>
         </action>
         <action class="org.zaizi.alfresco.module.valueretail.villagewww.avm.wf.AVMCheckServerAvailability" />
      </event>
        <transition name="busy" to="checkserveravailability"/>
        <transition name="available" to="review">
           <cancel-timer name="repeaterTimer"/>
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("Publishing the content to Prelive!");
               </script>
         </action>
         <exception-handler>
            <action class="org.alfresco.repo.avm.wf.AVMReleaseTestServerHandler"/>
         </exception-handler>
         <condition>#{wf_serverAvailable != null &amp;&amp; wf_serverAvailable == true}</condition>
        </transition>
   </decision>

El proceso lo hace bien, pero cuando esta a la espera y un servidor TEST se libera, el workflow parece que sigue su ejecucion. Pero, antes de terminar con la tarea siempre recibo el siguiente error y el workflow se queda estancado ya que no hay timer.

21:19:36,394  ERROR [repo.transaction.AlfrescoTransactionSupport] After completion (rolled-back) listener exception:
   listener: org.alfresco.repo.workflow.jbpm.JBPMTransactionTemplate@a0590509
org.jbpm.JbpmException: closed JbpmContext in different order then they were created… check your try-finally's around JbpmContexts blocks
   at org.jbpm.JbpmConfiguration.popJbpmContext(JbpmConfiguration.java:707)
   at org.jbpm.JbpmConfiguration.jbpmContextClosed(JbpmConfiguration.java:720)
   at org.jbpm.JbpmContext.close(JbpmContext.java:144)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.releaseContext(JbpmTemplate.java:111)
   at org.alfresco.repo.workflow.jbpm.JBPMTransactionTemplate.afterRollback(JBPMTransactionTemplate.java:189)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.afterCompletion(AlfrescoTransactionSupport.java:824)
   at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:996)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:971)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:874)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:822)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:412)
   at org.alfresco.util.transaction.SpringAwareUserTransaction.completeTransactionAfterThrowing(SpringAwareUserTransaction.java:567)
   at org.alfresco.util.transaction.SpringAwareUserTransaction.rollback(SpringAwareUserTransaction.java:537)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:394)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:232)
   at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread.executeJob(AlfrescoJobExecutorThread.java:187)
   at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
21:19:36,408  ERROR [workflow.jbpm.AlfrescoJobExecutorThread] failed to execute Timer(repeaterTimer,2010-12-19 21:19:33,000,Token(/))
org.jbpm.JbpmException: closed JbpmContext in different order then they were created… check your try-finally's around JbpmContexts blocks
   at org.jbpm.JbpmConfiguration.popJbpmContext(JbpmConfiguration.java:707)
   at org.jbpm.JbpmConfiguration.jbpmContextClosed(JbpmConfiguration.java:720)
   at org.jbpm.JbpmContext.close(JbpmContext.java:144)
   at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread$3.execute(AlfrescoJobExecutorThread.java:222)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:325)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:232)
   at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread.executeJob(AlfrescoJobExecutorThread.java:187)
   at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)

Alguna idea del porque o de como solucionarlo??

Gracias!
2 Replies
fstnboy
Active Member

Re: Problema con timer en workflow

Alguna idea de alguien? Nadie ha tenido este problema?
fstnboy
Active Member

Re: Problema con timer en workflow

Para el que le interese:

el problema era que en la tarea "review" usaba una clase que publicaba los cambios en el servidor tipo TEST disponible. Dicha clase usaba el workflow service para recuperar el contenido del paquete del workflow. Por alguna razon parece que existen problemas al usar el workflow service en una clase Java y con Timers.. Mismo problema en este hilo del foro ingles

Saludos