10 Replies Latest reply on Jan 25, 2007 5:17 PM by juangiovanolli

    How to save process instance into database?

    slacker27

      the next is my code :

      private void execute() throws Exception {

      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
      GraphSession graphSession = jbpmContext.getGraphSession();
      TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();

      long processDefinitionId = 1;
      org.jbpm.graph.def.ProcessDefinition processDefinition = graphSession.loadProcessDefinition(processDefinitionId);
      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      org.jbpm.taskmgmt.exe.TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();

      processInstance.signal();

      jbpmContext.save(processInstance);

      System.out.println(jbpmContext.getSession().isOpen());

      Token token = processInstance.getRootToken();
      System.out.println("LAST NODE:" + token.getNode().getName());

      }


      after i execute it, i found the process instance data has not been saved in db(mysql),
      And I know if i call "jbpmContext.close()" explicitly, it was saved.
      Has there any other ways to do that?
      (for example: by modifing the configuration file and do not midifing the code)


      And when i config my :jbpm.cfg.xml" followed the direction in chapter 7 in the user's guide like this:










      exception thrown:
      Exception in thread "main" org.jbpm.JbpmException: couldn't parse jbpm configuration from resource 'jbpm.cfg.xml'
      at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:284)
      at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:256)
      at Test.execute(Test.java:30)
      at Test.main(Test.java:23)


      Why?


      Thanks!

        • 1. Re: How to save process instance into database?
          kukeltje

           

          And I know if i call "jbpmContext.close()" explicitly, it was saved.
          Has there any other ways to do that?


          No


          • 2. Re: How to save process instance into database?

            Just wondering...

            Is it possible that the use of "findLatestProcessDefinition" instead of "loadProcessDefinition" correct the problem?

            Regards.

            • 3. Re: How to save process instance into database?

              BTW slacker, I had a problem while using JBoss Seam along with jBPM, a problem with the DB; can you let me take a look at your code? I used the same approach as you (by parsing the jbpm.cfg.xml file) and after a few tries I could solve my problem (not a very orthodox way, but is working). Maybe I could help there...

              Regards.

              • 4. Re: How to save process instance into database?

                And PLEASE, let me know what version of jBPM are you using, because there is NO line 284 (blank line) in the JbpmConfiguration.java file I'm seeing (jBPM 3.1.2).

                Regards.

                • 5. Re: How to save process instance into database?
                  dengzi725

                  hi . maybe it is simple .
                  after you save your processinstance , you must call jbpmContext.save() method . that the log , instance , token etc can be saved in your database .

                  you can try again .

                  • 6. Re: How to save process instance into database?
                    dengzi725

                    sorry, you must call jbpmContext.close().

                    • 7. Re: How to save process instance into database?
                      zhoudengwang

                      public long newProcessInstance(
                      java.lang.String processName,
                      java.util.Map context) throws Exception {
                      ProcessInstance pi = null;
                      JbpmConfiguration jc = getJbpmConfiguration();
                      if (jc == null)
                      return -1;
                      JbpmContext jct = jc.createJbpmContext();
                      try {
                      pi = jct.newProcessInstance(processName);
                      jct.save(pi);
                      jct.close(); } catch (Exception e) {
                      log.error("newProcessInstance", e);
                      }
                      return pi.getId();
                      }

                      error:
                      22:37:35,922 ERROR [JDBCTransaction] JDBC commit failed
                      java.sql.SQLException: You cannot commit during a managed transaction!
                      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:432)
                      at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:331)
                      at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
                      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
                      at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:161)
                      at org.jbpm.svc.Services.close(Services.java:211)
                      at org.jbpm.JbpmContext.close(JbpmContext.java:138)
                      at ejb.JbpmServiceBean.newProcessInstance(JbpmServiceBean.java:130)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:585)
                      at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
                      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
                      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
                      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
                      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
                      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
                      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
                      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
                      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
                      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
                      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
                      at org.jboss.ejb.Container.invoke(Container.java:873)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:585)
                      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
                      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:585)
                      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
                      at sun.rmi.transport.Transport$1.run(Transport.java:153)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
                      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
                      at java.lang.Thread.run(Thread.java:595)

                      • 8. Re: How to save process instance into database?
                        juangiovanolli

                        why the jbpmContext d0n't save the taksinstances of a processinstances when this is saved, even if you use jbpmContext.close()???
                        i need persist the task instances at the same time that the processinstance.
                        Shall any help me???

                        • 9. Re: How to save process instance into database?
                          aguizar

                           

                          java.sql.SQLException: You cannot commit during a managed transaction!

                          this has been addressed a lot of times in the forums. please use the search functionality and look for "CMT".

                          Chapter "Persistence" of the user guide addresses this topic as well.

                          • 10. Re: How to save process instance into database?
                            juangiovanolli

                            i'm doing all that the documentation says, but i get this error when i try to persist this:

                            org.jbpm.persistence.JbpmPersistenceException: couldn't flush hibernate session
                             at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:182)
                             at org.jbpm.svc.Services.close(Services.java:211)
                             at org.jbpm.JbpmContext.close(JbpmContext.java:139)
                             at com.santex.darwin.service.workflow.impl.WorkflowManagerImpl.save(WorkflowManagerImpl.java:365)
                             at com.santex.darwin.service.workflow.impl.WorkflowManagerImpl$$FastClassByCGLIB$$95ceb7e9.invoke(<generated>)
                             at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                             at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
                             at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInterceptor.java:79)
                             at org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.java:58)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:51)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:28)
                             at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
                             at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:23)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:39)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:31)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
                             at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
                             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
                             at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:145)
                             at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:80)
                             at com.santex.darwin.service.workflow.impl.WorkflowManagerImpl$$EnhancerByCGLIB$$d6d69392.save(<generated>)
                             at com.santex.darwin.example.WorkflowAdminHomeExample.addWorkflowInstance(WorkflowAdminHomeExample.java:58)
                             at com.santex.darwin.example.WorkflowAdminHomeExample$$FastClassByCGLIB$$135f4d0c.invoke(<generated>)
                             at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                             at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
                             at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInterceptor.java:79)
                             at org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.java:58)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:51)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:28)
                             at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
                             at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:23)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:39)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:31)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                             at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
                             at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
                             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
                             at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:145)
                             at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:80)
                             at com.santex.darwin.example.WorkflowAdminHomeExample$$EnhancerByCGLIB$$3aa70955.addWorkflowInstance(<generated>)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
                             at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:59)
                             at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:74)
                             at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:102)
                             at org.jboss.seam.core.Pages.callAction(Pages.java:308)
                             at org.jboss.seam.core.Pages.enterPage(Pages.java:255)
                             at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:253)
                             at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:202)
                             at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:53)
                             at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
                             at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
                             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                             at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:92)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                             at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                             at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                             at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                             at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
                             at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                             at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                             at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                             at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                             at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                             at java.lang.Thread.run(Thread.java:595)
                            Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.taskmgmt.exe.TaskMgmtInstance
                             at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
                             at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
                             at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
                             at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:482)
                             at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3056)
                             at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:474)
                             at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:197)
                             at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
                             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.close(DbPersistenceService.java:180)
                             ... 225 more
                            


                            so, what do you tellme about that? Thanks in advance (Gracias por adelantado)