1 Reply Latest reply on Feb 6, 2008 4:44 AM by tom_goring

    How to propagate the execution for a Node ?

    ricardo.almeida

      Hi,

      I have the following process definition:

      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="spa-process">
      
       <start-state name="Start">
       <transition to="publish_node" name="to_publish_node"/>
       </start-state>
      
       <node name="publish_node">
       <action expression="#{publishManager.publish}"/>
       <transition to="input_data" name="to_input_data"/>
       </node>
      
       <task-node name="input_data">
       <transition to="published" name="to_published"/>
       </task-node>
      
       <end-state name="published"/>
      </process-definition>


      I need to know how to propagate the execution of the process after the execution of the method 'publish()', in order to go to task 'input_date'. I already tried a lot of different ways, but none of them worked:

      I tried to Inject the BusinessProcess in the PublishManager object:

      @In
      private BusinessProcess businessProcess;
      


      and in the end of publish() method calls:

      businessProcess.transition("to_input_data");



      but when this line is executed I got the exception (this is the bottom of stack trace, the whole thing is enormous):
      Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
       at org.hibernate.loader.Loader.doQuery(Loader.java:673)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
       at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
       at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
       at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
       at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
       at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
       at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
       at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
       at org.hibernate.collection.PersistentList.iterator(PersistentList.java:115)
       at org.jbpm.graph.def.GraphElement.findExceptionHandler(GraphElement.java:386)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:349)
       ... 203 more
      Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53dede89:c2e:47a96efb:31 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53dede89:c2e:47a96efb:31 status: ActionStatus.ABORT_ONLY >)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
       ... 218 more
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -53dede89:c2e:47a96efb:31 status: ActionStatus.ABORT_ONLY >
       at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       ... 220 more



      Any idea of what is wrong or what i should do ?


      Thanks,
      Ricardo de Almeida

        • 1. Re: How to propagate the execution for a Node ?
          tom_goring

          Hi,

          Is it not just a case of changing:

           <node name="publish_node">
           <action expression="#{publishManager.publish}"/>
           <transition to="input_data" name="to_input_data"/>
           </node>
          


          to

           <node name="publish_node">
           <transition to="input_data">
           <action expression="#{publishManager.publish}"/>
           </transition>
           </node>