1 Reply Latest reply on Mar 23, 2012 11:57 AM by gardellajp

    JBPM Workflow colliding with Task Service

    vchmakov

      Hi,

       

      As recommended in JBPM/Drools documentation to support my workflow/Drools operations I’m exposing a singleton service object. The workload on the JBPM/Drools engine is very lite at the moment and therefore I create one session and serialize all commands receiving them  via the message queue. Everything seems to be working fine. Now, when the Task Server (MINA implementation) is completing tasks and resuming suspended workflows they inevitably collide with the execution of the main trunk. It is not a problem to make my service singleton thread-safe, however I’m also exposing a transactional context including one-per-transaction instance of the Entity Manager which obviously should be different for the Task Completion thread. Besides I have no control over the transactional context of the Task Server and therefore unable to prepare the data and services for processing of the command.

      Here come the questions:

      • Is there a solution for the issue?
      • Is there an issue at all or I’m overlooking/misunderstanding something?
      • What is the best practices for programming such sort of operations in JBPM?
      • Has anyone been dealing with such kind of problems working with JBPM?

       

      I do not mind looking through the sources of the JBPM/Drools which I do all the time when debugging, but if possible I’d like to hear from the gurus.

       

      Any advice is highly appreciated.

       

      Thanks,

       

      Vlad

       

      1. P.S.: the current version I’m working with is 5.1.2, however, my tests show the same results working with 5.2.0. Besides, I’m working with modified version of the 5.1.2 Human Tasks code, where I implement JTA-style transactions, which is now standard in 5.2.0.
        • 1. Re: JBPM Workflow colliding with Task Service
          gardellajp

          Hi,

           

          I had the same issue and I've resolved using local task service (transactional). With apache mina I've lost much time with varios problems. With mina you can't run in a transacction the operations.

           

          I create one (persistent) session each time I create a process, no one global session as you do, but not matter how handle the sessions. I suppose have more control on the memory used. But I must fix a class, check https://community.jboss.org/message/722803.

           

          Juan