1 Reply Latest reply on Sep 13, 2012 6:41 AM by supritchaudhary

    jBPM 5.2 with Custom transactions.

    chetansh

      I need to create BPM desinger Node. One node will be resposible to start a transaction and another one will be responsible to commit the same transaction that was started by the earlier node.

      Could someone tell me how can I build the same functionlality?

       

      We tried using JTA, User Trasaction but have been getting errors that the Transaction is already running and cannot be started, kind of errors.

       

      Should I build it using EJB's? with the EJB's working as CMT? If yes can someone guide on the same?

       

      Regards,

      chetan

        • 1. Re: jBPM 5.2 with Custom transactions.
          supritchaudhary

          If you have service task in workflow, they all will run in same thread context, which have started the process.

          In the very first service task call "userTransaction.begin();" and in the the last service task call "userTransaction.commit();"

          Remeber to call flush() followed by persist() to avoid transaction errors.

          Sample Code:

               "entityManager.persist(someObject); entityManager.flush();"