0 Replies Latest reply on May 14, 2012 8:10 AM by dboyd68

    KnowledgeSession issues and best practice

    dboyd68

      Hey All,

       

      I have an interesting scenario that I would like to advice on.

       

      I am new to JBPM so appoligies if this is a silly question.

       


      My Scenario is this

       

      I have a number of knowledge sessions in Stateless sessions beans. (So not one knolwedge session per request and not a singleton knowledgesession either... understand this is a bad design but stick with me)

       

      The last step in this "fails"

       

       

      signal event (workflow 1)

           within server task execute inner step

      Inner Step         

                start  new process (workflow 2)

                    raise seam event

                   catch seam event (somewhere else)

                         siginal event to move workflow 2 along.

       

       

      My problem is in the last step. Workflow 2 is started but it is never moved i.e. singal event seems to have no effect. Debugging  the code it appears that the internal process instance has the wrong nodes and doesn't actually fire execute anything (no excpetions are raised though)

       

      Attempted solutions.

      1) I attempted to add a  flush() on the entity manager associated with JBPM at ever step. Figured it might be multiple knowledge sessions who haven't flushed data yet. However this didn't help.

       

      2) Make one knowledge session shared by every stateless session bean. This seems to solve the issue but I don't understand why this would work and flush wouldn't.

       

      I am using CMP within a J2EE environment on JBPM 5.1 on JBoss 4.2

       

       

      Can anyone shed some light on why this might occur? Or if a singleton knowledge session is a valid design?