1 2 Previous Next 24 Replies Latest reply on Jun 2, 2009 4:47 AM by François LE QUEMENER

    Ending tasks manually

    Hugo Wurzelbutz Newbie

      Hi,

      i'm trying to end a taskinstance from an external application.
      Therefor i created the following method:

       public String externalTaskActions(){
      
       if(ext_action.equalsIgnoreCase("end"))
       log.debug("Trying to end task "+ext_aufgabenID+" over transition "+ext_transition);
       if(ext_action.equalsIgnoreCase("start"))
       log.debug("Trying to start task "+ext_aufgabenID);
      
       TaskInstance ti=em.find(TaskInstance.class, ext_aufgabenID);
       if(ext_action.equalsIgnoreCase("end")){
       if(ti!=null)
       {
       Transition tr=ti.getTask().getTaskNode().getLeavingTransition(ext_transition);
       if(tr!=null) {ti.end(ext_transition); log.debug("Transition is not null: "+tr.getName()+"/"+tr.getId());}
       else { ti.end(); log.debug("Transition is null");}
      
       log.debug("Ended "+ti.getName()+" manually");
       return "external_window";
       }
       else {
       log.debug("Transition is empty");
       }
       }
      
       else if(ext_action.equalsIgnoreCase("start")){
       if(ti!=null){
       ti.start();
       log.debug("Started "+ti.getName()+" manually");
       return "external_window";
       }else{
       log.debug("TaskInstance is null");
       }
       } else {
       }
       return null;
       }
      

      ext_aufgabenID is the TaskInstanceID, ext_transition is the name of the transition to take.

      starting a task works well,
      ending a task which has only 1 leaving transition works well (ext_transition is NULL then) but ending a task which has multiple leaving transitions doesn't work at all.
      i get the following errors:

      2009-05-06 14:47:45,468 DEBUG [at.test.session.ExternalTaskAction] Trying to end task 5 over transition rechts
      14:47:45,515 WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
      2009-05-06 14:47:45,546 DEBUG [at.test.session.ExternalTaskAction] Transition is not null: rechts/14090
      2009-05-06 14:47:45,546 DEBUG [at.test.session.ExternalTaskAction] Ended links oder rechts?/5 manually
      14:47:45,562 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@8ef05b
      javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: org.jbpm.taskmgmt.exe.TaskInstance
      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
      at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:524)
      at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
      at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
      at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
      at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
      at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
      at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
      at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:614)
      at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPageActions(SeamPhaseListener.java:352)
      at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:571)
      at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
      at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
      at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      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(Unknown Source)
      Caused by: org.hibernate.PersistentObjectException: detached entity passed to persist: org.jbpm.taskmgmt.exe.TaskInstance
      at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79)
      at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:644)
      at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:636)
      at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:323)
      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
      at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
      at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:456)
      at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:111)
      at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:84)
      at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:644)
      at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:636)
      at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:323)
      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
      at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
      at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
      at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
      at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
      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.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
      ... 60 more
      14:47:45,625 WARN [JDBCExceptionReporter] SQL Error: 1452, SQLState: 23000
      14:47:45,625 ERROR [JDBCExceptionReporter] Cannot add or update a child row: a foreign key constraint fails (`test/jbpm_log`, CONSTRAINT `FK_LOG_TASKINST` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`))
      14:47:45,625 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
      org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:55)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
      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.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:272)
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:232)
      at org.jbpm.svc.Services.close(Services.java:225)
      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
      at org.jboss.seam.Component.destroy(Component.java:1436)
      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      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(Unknown Source)
      14:47:45,625 ERROR [DbPersistenceService] hibernate flush failed
      org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:55)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
      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.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:272)
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:232)
      at org.jbpm.svc.Services.close(Services.java:225)
      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
      at org.jboss.seam.Component.destroy(Component.java:1436)
      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      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(Unknown Source)
      14:47:45,625 ERROR [DbPersistenceService] hibernate rollback failed
      java.lang.NullPointerException
      at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:304)
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:234)
      at org.jbpm.svc.Services.close(Services.java:225)
      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
      at org.jboss.seam.Component.destroy(Component.java:1436)
      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      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(Unknown Source)
      14:47:45,625 ERROR [Services] problem closing service 'persistence'
      org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:237)
      at org.jbpm.svc.Services.close(Services.java:225)
      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
      at org.jboss.seam.Component.destroy(Component.java:1436)
      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      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(Unknown Source)
      Caused by: org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:55)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
      at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
      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.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:272)
      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:232)
      ... 64 more
      14:47:45,625 WARN [Component] Exception calling component @Destroy method: org.jboss.seam.bpm.jbpmContext
      org.hibernate.exception.ConstraintViolationException: could not insert: [org.jbpm.taskmgmt.log.TaskAssignLog]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)
      at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
      at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
      at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
      at org.jbpm.logging.db.DbLoggingService.log(DbLoggingService.java:50)
      at org.jbpm.svc.save.SaveLogsOperation.save(SaveLogsOperation.java:47)
      at org.jbpm.svc.Services.save(Services.java:164)
      at org.jbpm.JbpmContext.save(JbpmContext.java:427)
      at org.jbpm.JbpmContext.autoSave(JbpmContext.java:620)
      at org.jbpm.JbpmContext.close(JbpmContext.java:137)
      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
      at org.jboss.seam.Component.destroy(Component.java:1436)
      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      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(Unknown Source)
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`test/jbpm_log`, CONSTRAINT `FK_LOG_TASKINST` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`))
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
      at com.mysql.jdbc.Util.getInstance(Util.java:381)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949)
      at com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:874)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
      at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
      at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
      ... 83 more


      Do you have any ideas how to avoid the exception?
      Is there a better way to end a taskinstance?

      I'm using Jboss jBPM-jPDL 3.2.3 and SEAM 2.1.1.GA.


        • 1. Re: Ending tasks manually
          Ronald van Kuijk Master

          try using something like

          ti.getTask().getTaskNode().hasLeavingTransition(ext_transition);

          which returns a boolean.

          Also just signalling it with a transition that does not exist is an option and catching the exeption



          • 2. Re: Ending tasks manually
            Hugo Wurzelbutz Newbie

            i know that the Taskinstance has leaving transitions (hasLeavingTransition(ext_transition) returns true).
            Transition tr=ti.getTask().getTaskNode().getLeavingTransition(ext_transition);
            finds the correct transition.

            It just seems as jbpm has troubles following it.

            As i said ending a taskinstance which has only 1 leaving transitions works well.

            here is the process definition, maby that helps:


            <?xml version="1.0" encoding="UTF-8"?>
            
            <process-definition xmlns="" name="test">
             <start-state name="start-state1">
             <transition to="entscheidung"></transition>
             </start-state>
             <task-node name="links">
             <task name="links">
             <assignment class="at.test.session.UserAssignmentActor"></assignment>
             </task>
             <transition to="end-state1"></transition>
             </task-node>
            
             <task-node name="rechts">
             <task name="rechts">
             <assignment class="at.test.session.UserAssignmentActor"></assignment>
             </task>
             <transition to="end-state1"></transition>
             </task-node>
            
             <task-node name="entscheidung">
             <task name="links oder rechts?">
             <assignment class="at.test.session.UserAssignmentActor"></assignment>
             </task>
             <transition to="rechts" name="rechts"></transition>
             <transition to="links" name="links"></transition>
             </task-node>
            
             <end-state name="end-state1"></end-state>
            </process-definition>


            of course i could just catch the exception but the problem is that the taskinstance doesn't get ended.

            i find interesting that jbpm tries to persist a taskinstance (the target of the transition i assume) which supposedly exists:
            Caused by: org.hibernate.PersistentObjectException: detached entity passed to persist: org.jbpm.taskmgmt.exe.TaskInstance
            (from the stacktrace)

            • 3. Re: Ending tasks manually
              Ron Wallis Newbie

              This is how I end tasks:

              <![CDATA[
              token.unlock();
              taskInstance.end();
              ]]>


              If its a timer that signals the token and the task needs to therefore be automatically ended then I also make sure the end-tasks= true attribute on the task node is set.
              <task-node name="Sometasknodet" end-tasks="true">


              • 4. Re: Ending tasks manually
                Ronald van Kuijk Master

                what I proposed was not retrieving the Transition at all, since that my be the cause of the error.

                • 5. Re: Ending tasks manually
                  Hugo Wurzelbutz Newbie

                  just ending the task is not the problem.

                  Ending AND specifying a transition is.

                  @kukeltje: i changed my code according to your suggestion but still i'm getting the error:

                  2009-05-07 15:26:15,656 DEBUG [at.test.session.ExternalTaskAction] Trying to end task 5 over transition links
                  2009-05-07 15:26:15,750 DEBUG [at.test.session.ExternalTaskAction] transition exists: true
                  15:26:15,843 WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==

                  --- now the UserAssignmentActor tries to assign the new Taskinstance to me (seams to work)---

                  2009-05-07 15:26:15,921 DEBUG [at.test.session.ExternalTaskAction] Transition is not null: links
                  2009-05-07 15:26:15,921 DEBUG [at.test.session.ExternalTaskAction] Ended links oder rechts?/5 manually
                  15:26:15,937 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@67d5fe
                  javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: org.jbpm.taskmgmt.exe.TaskInstance
                  at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
                  at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:524)
                  at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
                  at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
                  at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
                  at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
                  at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
                  at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
                  at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
                  at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
                  at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
                  at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:614)
                  at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPageActions(SeamPhaseListener.java:352)
                  at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:571)
                  at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
                  at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
                  at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
                  at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
                  at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                  at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                  at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                  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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                  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(Unknown Source)
                  ...


                  • 6. Re: Ending tasks manually
                    Ronald van Kuijk Master

                    Where is the error? I only see a warning. The error that was in the initial stacktrace is not there

                    • 7. Re: Ending tasks manually
                      Hugo Wurzelbutz Newbie

                      sorry i didnt post the full stacktrace. here it is:

                      17:10:30,859 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@1c50523
                      javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: org.jbpm.taskmgmt.exe.TaskInstance
                      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
                      at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:524)
                      at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
                      at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
                      at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
                      at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
                      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
                      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
                      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
                      at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
                      at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
                      at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:614)
                      at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPageActions(SeamPhaseListener.java:352)
                      at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:571)
                      at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:473)
                      at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
                      at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
                      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                      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(Unknown Source)
                      Caused by: org.hibernate.PersistentObjectException: detached entity passed to persist: org.jbpm.taskmgmt.exe.TaskInstance
                      at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79)
                      at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:644)
                      at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:636)
                      at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:323)
                      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
                      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
                      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
                      at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
                      at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
                      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
                      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
                      at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
                      at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:456)
                      at org.hibernate.event.def.DefaultPersistEventListener.entityIsPersistent(DefaultPersistEventListener.java:111)
                      at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:84)
                      at org.hibernate.impl.SessionImpl.firePersistOnFlush(SessionImpl.java:644)
                      at org.hibernate.impl.SessionImpl.persistOnFlush(SessionImpl.java:636)
                      at org.hibernate.engine.CascadingAction$9.cascade(CascadingAction.java:323)
                      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
                      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
                      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
                      at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
                      at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
                      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
                      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
                      at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
                      at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
                      at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
                      at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
                      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.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
                      ... 60 more
                      17:10:31,015 WARN [JDBCExceptionReporter] SQL Error: 1452, SQLState: 23000
                      17:10:31,015 ERROR [JDBCExceptionReporter] Cannot add or update a child row: a foreign key constraint fails (`test/jbpm_log`, CONSTRAINT `FK_LOG_TASKINST` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`))
                      17:10:31,015 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
                      org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:55)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
                      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.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:272)
                      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:232)
                      at org.jbpm.svc.Services.close(Services.java:225)
                      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
                      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
                      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
                      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
                      at org.jboss.seam.Component.destroy(Component.java:1436)
                      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
                      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
                      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                      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(Unknown Source)
                      17:10:31,015 ERROR [DbPersistenceService] hibernate flush failed
                      org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:55)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
                      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.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:272)
                      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:232)
                      at org.jbpm.svc.Services.close(Services.java:225)
                      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
                      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
                      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
                      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
                      at org.jboss.seam.Component.destroy(Component.java:1436)
                      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
                      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
                      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                      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(Unknown Source)
                      17:10:31,015 ERROR [DbPersistenceService] hibernate rollback failed
                      java.lang.NullPointerException
                      at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:304)
                      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:234)
                      at org.jbpm.svc.Services.close(Services.java:225)
                      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
                      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
                      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
                      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
                      at org.jboss.seam.Component.destroy(Component.java:1436)
                      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
                      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
                      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                      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(Unknown Source)
                      17:10:31,015 ERROR [Services] problem closing service 'persistence'
                      org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed
                      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:237)
                      at org.jbpm.svc.Services.close(Services.java:225)
                      at org.jbpm.JbpmContext.close(JbpmContext.java:139)
                      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
                      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
                      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
                      at org.jboss.seam.Component.destroy(Component.java:1436)
                      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
                      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
                      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                      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(Unknown Source)
                      Caused by: org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:55)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
                      at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
                      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.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:272)
                      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:232)
                      ... 64 more
                      17:10:31,015 WARN [Component] Exception calling component @Destroy method: org.jboss.seam.bpm.jbpmContext
                      org.hibernate.exception.ConstraintViolationException: could not insert: [org.jbpm.taskmgmt.log.TaskAssignLog]
                      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
                      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                      at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)
                      at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
                      at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
                      at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
                      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
                      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
                      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
                      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
                      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
                      at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
                      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
                      at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
                      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
                      at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
                      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
                      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
                      at org.jbpm.logging.db.DbLoggingService.log(DbLoggingService.java:50)
                      at org.jbpm.svc.save.SaveLogsOperation.save(SaveLogsOperation.java:47)
                      at org.jbpm.svc.Services.save(Services.java:164)
                      at org.jbpm.JbpmContext.save(JbpmContext.java:427)
                      at org.jbpm.JbpmContext.autoSave(JbpmContext.java:620)
                      at org.jbpm.JbpmContext.close(JbpmContext.java:137)
                      at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
                      at org.jboss.seam.bpm.ManagedJbpmContext.destroy(ManagedJbpmContext.java:148)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                      at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
                      at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
                      at org.jboss.seam.Component.destroy(Component.java:1436)
                      at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
                      at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
                      at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
                      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                      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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                      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(Unknown Source)
                      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`test/jbpm_log`, CONSTRAINT `FK_LOG_TASKINST` FOREIGN KEY (`TASKINSTANCE_`) REFERENCES `jbpm_taskinstance` (`ID_`))
                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                      at java.lang.reflect.Constructor.newInstance(Unknown Source)
                      at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
                      at com.mysql.jdbc.Util.getInstance(Util.java:381)
                      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
                      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
                      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
                      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
                      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
                      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
                      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
                      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
                      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046)
                      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964)
                      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949)
                      at com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:874)
                      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
                      at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
                      at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
                      ... 83 more


                      i tried to end the taskinstances by calling token.end(transition_name). it produces the same exception.

                      do i need to initialize something?

                      here is what i do:
                      i use a link(with request parameters) to open a SEAM page.
                      in pages.xml i added an action which should be called before rendering the page:
                      <page view-id="/external_task_actions.xhtml" action="#{externalTaskAction.externalTaskActions}"/>

                      the contents of externalTaskActions() is shown in my first post.

                      afer some testing i found out that i cant end taskinstances which lead to another node (except for the end node).

                      • 8. Re: Ending tasks manually
                        Hugo Wurzelbutz Newbie

                        Good news everyone!

                        i was able to resolve the problem:
                        i now inject the jbpmContext and rerieve the taskinstance from there.

                        ending taskinstances (with or without specifying a transition) now works
                        *happy*

                        here is my code, maybe it helps so. else:

                        public String externalTaskActions(){
                         if(jbpmContext!=null) log.debug("jbpmContext not null");
                         if(ext_action.equalsIgnoreCase("end"))
                         log.debug("Trying to end task "+ext_aufgabenID+" over transition "+ext_transition);
                         if(ext_action.equalsIgnoreCase("start"))
                         log.debug("Trying to start task "+ext_aufgabenID);
                        
                         TaskInstance ti=jbpmContext.getTaskInstance(ext_aufgabenID);
                         if(ext_action.equalsIgnoreCase("end")){
                         if(ti!=null)
                         {
                         if(ext_transition!=null) {
                         ti.end(ext_transition);
                         log.debug("Transition is not null: "+ext_transition);
                         }
                         else { ti.end(); log.debug("Transition is null");}
                         log.debug("Ended "+ti.getName()+"/"+ti.getId()+" manually");
                         return "external_window";
                         }
                         else {
                         log.debug("Transition is empty");
                         //TODO exception?
                         }
                         }
                        
                         else if(ext_action.equalsIgnoreCase("start")){
                         if(ti!=null){
                         ti.start();
                         log.debug("Started "+ti.getName()+" manually");
                         return "external_window";
                         }else{
                         log.debug("TaskInstance is null");
                         //TODO exception?
                         }
                         } else {
                         //TODO falsche aktion
                         }
                        
                         return null;
                         }
                        


                        thanks for your suggestions kukeltje

                        • 9. Re: Ending tasks manually
                          Ronald van Kuijk Master

                          aaaahhhhh shoot.... I missed that part... sorry...Yes, the latter is the better solution (and the way I always do it)

                          • 10. Re: Ending tasks manually
                            François LE QUEMENER Newbie

                            Hum I'm encountering the same problem, but I can't make it work. Like you, I want to choose one transition among 2 existing. WHen I try this:

                            Transition tr=taskInstance.getTask().getTaskNode().getLeavingTransition("refusee");


                            I get the good transition. But when I do task.end(tr), it always takes the first transition (without any error).

                            Here is the complete code:

                            JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
                            try {
                            
                             processInstance = jbpmContext.loadProcessInstance(processInstanceId);
                            
                             TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
                             @SuppressWarnings(value={"unchecked"}) //taskMgmtSession returns a raw List... We ignore the warning thrown by Java
                             List<TaskInstance> userTaskList = taskMgmtSession.findTaskInstances(demande.getValideur().getUsername());
                            
                             for(int i = 0 ; i < userTaskList.size() ; i++)
                             {
                             TaskInstance taskInstance = userTaskList.get(i);
                             if(taskInstance.getProcessInstance().getId() == processInstanceId)
                             {
                             if(taskInstance.getName().equals("valider_demande"))
                             {
                             processInstance.getContextInstance().setVariable("demande", demande);
                             Transition tr=taskInstance.getTask().getTaskNode().getLeavingTransition("refusee");
                             taskInstance.end(tr);
                             break;
                             }
                             }
                             }
                            
                             }
                            


                            • 11. Re: Ending tasks manually
                              Ronald van Kuijk Master

                              what is the value of tr? is it 'null' by accident?

                              • 12. Re: Ending tasks manually
                                Hugo Wurzelbutz Newbie

                                are you sure .getLeavingTransition("refusee") returns the correct one?

                                maybe cou could try this

                                try {
                                
                                 processInstance = jbpmContext.loadProcessInstance(processInstanceId);
                                
                                 TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
                                 @SuppressWarnings(value={"unchecked"}) //taskMgmtSession returns a raw List... We ignore the warning thrown by Java
                                 List<TaskInstance> userTaskList = taskMgmtSession.findTaskInstances(demande.getValideur().getUsername());
                                
                                 for(int i = 0 ; i < userTaskList.size() ; i++)
                                 {
                                 TaskInstance taskInstance = userTaskList.get(i);
                                 if(taskInstance.getProcessInstance().getId() == processInstanceId)
                                 {
                                 if(taskInstance.getName().equals("valider_demande"))
                                 {
                                 processInstance.getContextInstance().setVariable("demande", demande);
                                taskInstance =jbpmContext.getTaskInstance(taskInstance.getID());
                                Transition tr=taskInstance.getTask().getTaskNode().getLeavingTransition("refusee");
                                 taskInstance.end(tr);
                                 break;
                                 }
                                 }
                                 }
                                
                                 }
                                
                                




                                • 13. Re: Ending tasks manually
                                  Ronald van Kuijk Master

                                  I'm curious to what the added value of doing the following is

                                  taskInstance =jbpmContext.getTaskInstance(taskInstance.getID());




                                  • 14. Re: Ending tasks manually
                                    Hugo Wurzelbutz Newbie

                                    in my code the only thing that worked was reading the taskinstance with jbpmContext.getTaskInstance(). therefore i thought this could (i dont know if it does) make a difference.

                                    1 2 Previous Next