1 Reply Latest reply on Nov 15, 2011 8:39 AM by Mauricio Salatino

    New to JBPM5, trying to integrate with web application

    Michal Kowalski Newbie

      Hi all, I'm new to JBPM5 and I would like to create a sample web application which will allow to invoke tasks in my simple process.

      For the presentation layer I would like to use simple forms in Struts. The question is how to integrate them with jbpm?

       

      As I understand jbpm, first thing I should do is to create my process using BPMN eclipse plugin - I think I can make it. Then as an output I will have my xml file representing process. The next step is to create KnowledgeBase in web application.

      • Should I create KnowledgeBase as a singleton that will be available from every Action/Servlet? I think that creating KnowledgeBase is time consuming so there should be only one instance. What Action/Servlet does, is only creating StatefulKnowledgeSession per action request and then manipulation process using session. Am I right?

       

      But there is one more question.

      • I see that jbpm comes with admin console which helps in process maintenance. How should I make it available when integrating with struts web app? This feature is nice to have .

       

      Is my approach right? Or I should create standalone jbpm sever somehow?

       

      Thank you for any information!

        • 1. Re: New to JBPM5, trying to integrate with web application
          Mauricio Salatino Master

          Hi Michal,

          Cool, if you want to create a simple web application that shows the users the different tasks that appears in your processes you can use the jbpm-human-task module that provides an API to get the information about the pending tasks. Using this API you will be interacting with the human task component.

          In another place in your application you will need to create a new KnowledgeBase that contains the process definition and a session to execute new instances of that process definition. Because Business Processes that includes human tasks are usually (99.9% of the times) long running processes you will need to share the session between different requests. Here you will have some options, you can have one session per process instance or you can organize multiple process instances in the same session, but it really depends on your processes and your design. For keeping track of which session has each process you will need to write a very thin layer that allows you to interact with the right session and the right process instance.

           

          About integrating the admin console with your struts app, I think that you can, but if you want to modify the admin console you will need to learn GWT. I'm pretty sure that if you know well struts, replicating the code that is inside the admin console should not be difficult, but it is completely up to you.

           

          Cheers