2 Replies Latest reply on Jan 4, 2008 4:17 PM by apdo

    how to make multiple web applications sharing the same jbpm

    apdo Newbie

      I would like to have 2 web applications (on the same jboss server) sharing the same bpm. (i.e. sharing the same processdefinition, process instance taskinstance ...)
      This would allow one of the application to see the processes instantiated in the other web application.

      to try this I have done the following but I am not sure if it is the right way to do.

      I have use the seam todo example. I have package and deploy it to a jboss server.

      I have modify the seam todo exemple (application.xml and build.xml files) to rename the jar, war, ear as jboss-seam-todo2 instead of jboss-seam-todo. also, the context root has been modify to seam-todo2. I have package and deploy it to the same jboss server.

      both applications are connected to the same database.

      both applications are working fine. As I wanted, they can both see the process instantiated by the other web application.

      However, according to what I understand, both application have its own jbpm engine but share the same database. If it is the case, that is most probably not the way to share bpm among multiple web application.

      One point that surprise me is that according to my understanding, jbpm use hibernate that has cashing. For this reason, I have been surprise to see that both web application see the same list of process. I would not have expect this to work since according to my understanding the way I share bpm is at database level only.

      Is there somebody that can tell me if the way I am sharing bpm among multiple web applications on the same web server is correct or not?
      If not how do you propose to do it?

      An Phong Do
      solabs.com

        • 1. Re: how to make multiple web applications sharing the same j
          Pete Muir Master

          You should be able to start jbpm standalone and get Seam to connect to it overriding the getJbpmConfiguration method in the org.jboss.seam.bpm.jbpm component

          • 2. Re: how to make multiple web applications sharing the same j
            apdo Newbie

            Thanks for you reply

            We where already using jBPM deployed as a SAR in our application. I was first looking in that direction but according to my experimentation it is simpler now.

            I didn't explicitly mention in my first post that I did want to share jBPM for multiple web application "on the same jBoss server".

            Here is what I have done; can someone confirm that I am doing things the right way?

            My goal was to share a jBPM engine among multiple applications. I have followed the suggestion from Pete in my experimentations.

            I have deployed the seam-todo example. This application will be use has in my experimentation has the standalone jBPM.

            I than create a copy of the seam-todo example like I have done in my first post. I rename it to seam-todo3 and then I remove every jBPM library and configuration file. However, both seam-todo2 and seam-todo3 share the same class loader define in jboss-app.xml.

            I then deploy seam-todo3.

            From there, both seam-todo2 and seam-todo3 was sharing the same jBPM engine. I think it come from the fact that the JBpmConfiguration has its instance set has a static singleton and that they both use the default resource (call getInstance without parameter) jbpm.cfg.xml that is use has the keys of the instances map

            For this reason I didn't had to overwrite the getJbpmConfiguration of the jBPM component.

            Is what I am doing is all right?

            An Phong Do