2 Replies Latest reply on Nov 27, 2009 6:15 AM by mafemuea

    Problem with node state

    mafemuea

      Hello everybody.

      When it finish a task of my workflow has to wait (10 days, it's customizable), to advance to the next task (of another node).
      I tested with a 'node state' between the two nodes happend the following error:

      Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.graph.def.Action

      Thanks a lot.

        • 1. Re: Problem with node state
          sebastian.s

          You did not mention it but I concluded you are using jBPM 3.x. So I can't help you since I use 4.x. But I advise you to post your process definition and a unit test. Also see the post about reporting problems.

          • 2. Re: Problem with node state
            mafemuea

            Hello

            I post more information about my problem:

            I use jBPM 3.2.6.

            This is a part of workflow:

            .....
             <task-node name="Recepcion de catalogos">
             <description>
             Recepción de catálogos
             </description>
             <task name="Recepcionar catalogos">
             <description>
             recepcionarCatalogos.do
             </description>
             <assignment class="*.*.*.bussiness.jbpm.handler.assignment.AsignaPoolActorTarea"></assignment>
             </task>
             <transition to="Esperar para desmontar"></transition>
             </task-node>
             <state name="Esperar para desmontar">
             <event type="node-enter">
             <action name="Esperar para desmontar" class="*.*.*.bussiness.jbpm.handler.action.ConfigurarPlanificadorDesmontaje"></action>
             </event>
             <transition to="Valor mayor 500 mil"></transition>
             </state>
             <decision name="Valor mayor 500 mil">
             <handler class="*.*.*.bussiness.jbpm.handler.decision.ValorMayor500milEuros"></handler>
             <transition to="Solicitud desmontaje" name="No"></transition>
             <transition to="Solicitud de escolta desmontaje" name="Si"></transition>
             </decision>
            .....
            


            The handler class "ConfigurarPlanificadorDesmontaje":

             public void execute(ExecutionContext executionContext) throws Exception {
             try{
             logger.debug("[execute] Inicio");
             BusinessCalendar businessCalendar = new BusinessCalendar();
             Token token = executionContext.getToken();
             logger.debug("[execute] token name: " + executionContext.getToken());
             Timer timer = new Timer (token);
             timer.setName("TimerDesmontaje");
            
             Delegation delegation = new Delegation("*.*.*.bussiness.jbpm.handler.action.SalirPlanificadorDesmontaje");
             executionContext.getJbpmContext().getSession().save(delegation);
            
             Action action = new Action ();
             action.setName("Salir de planificador");
             action.setActionDelegation(delegation);
             timer.setAction(action);
             timer.setGraphElement(executionContext.getNode());
            
             String tiempo = "2 business minutes"; //TODO: Value dinamic, go to BD
             Duration duration = new Duration(tiempo);
             Date dueDateDate = businessCalendar.add(new Date(), duration);
             timer.setDueDate(dueDateDate);
            
             SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
             schedulerService.createTimer(timer);
             logger.debug("[execute] Fin");
             }catch(Exception e){
             throw e;
             }
             }
            
            


            And the handler class "SalirPlanificadorDesmontaje":
            public void execute(ExecutionContext context) throws Exception {
             try{
             logger.debug("[execute] Inicio");
            
             context.leaveNode();
             logger.debug("[execute] Fin");
             }catch (Exception e) {
             throw e;
             }
             }
            


            When it finish the task "Recepcion de catalogos", my workflow should wait time (String tiempo = "2 business minutes"; //TODO: Value dinamic, go to BD) before running the decision node "Valor mayor 500 mil", but happend the error:

            org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.graph.def.Action
            
             at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
             at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
             at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
             at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:597)
             at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3123)
             at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:479)
             at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:204)
             at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:127)
             at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
             at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
             at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
             at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
             at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
             at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
             at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:227)
             at org.jbpm.persistence.db.DbPersistenceService.endTransaction(DbPersistenceService.java:132)
             at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:198)
             at org.jbpm.svc.Services.close(Services.java:243)
             at org.jbpm.JbpmContext.close(JbpmContext.java:133)
             at *.*.*.bussiness.jbpm.managers.JBPMManager.finalizaTareaConIdActual(JBPMManager.java:223)
             at *.*.*.bussiness.managers.GestionarExposicionesManager.finalizarTareaRecepcionarCatalogos(GestionarExposicionesManager.java:277)
             at *.*.*.web.actions.tareas.RecepcionCatalogosAction.finalizarRecepcionCatalogos(RecepcionCatalogosAction.java:106)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
             at *.*.*.web.actions.GPEDispatchAction.execute(GPEDispatchAction.java:107)
             at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
             at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
             at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
             at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
             at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
             at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
             at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
             at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
             at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at es.bne.plataforma.seguridad.comun.web.filtros.PublicLoginFilter.doFilter(PublicLoginFilter.java:142)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
             at java.lang.Thread.run(Thread.java:619)
             ... 44 more
            


            Any idea to solve my problem? There a way to model the workflow to do I need?

            Thanks a lot.