2 Replies Latest reply on Nov 20, 2013 7:03 AM by quangtin3

    Integrate Human Task Forms in a JSF web app

    felipe.gdr

      I've been studying the jBPM 5 documentation for a while, and now I've reached a point where I need some good advice.

       

      I want to embed the jBPM engine into a web application (built using JSF, primefaces, etc...). I have already run some example processes in a web environment using HornetQ and Local task servers. Using task forms is what is really confusing me.

       

      If someone could help me answering the following questions, I would be much thankful.

       

      What is the best/correct way to do this integration?

       

      Should I use the forms created in Guvnor? In that case, how can I reuse components that are already part of my webapp (ex.:  a user needs to select an employee to start an evaluation process, this selection needs to be made from a autocomplete component, where the user starts typing the employee name and then chooses one employee from the option list)?

       

      Can I build the forms using JSF+Primefaces?  In that case, how do I associate the forms to the correspondent tasks?

       

      If someone could point me to a good resource, wiki, forum post, book... that would really help me too.

        • 1. Re: Integrate Human Task Forms in a JSF web app
          saikatm

          I do have the same question as Felipe ...

          How can I build the forms using JSF and Primefaces?

          In that case, how do I associate the forms to the correspondent tasks?

          • 2. Re: Integrate Human Task Forms in a JSF web app
            quangtin3

            Hi Saikat and Felipe:

            In a project that we're working on (embedded JBPM 5.x) has some points related to your questions, so I will try to summary some information related to the questions in hope it helps.

            1. What is the best/correct way to do this integration? (TaskFrom)

            I've been doing work related to jbpm for sometime, but not long enought, So I'm looking for an answer too.

            2. Should I use the forms created in Guvnor? In that case, how can I reuse components that are already part of my webapp <... > ?

            jBPM 6 will support extending jbpm via plugin (combined of guvnor, drools, console). But in jBPM 5.4 so far, I don't think we can extend jBPM (gwt-console*) other than make the change directly to jbpm-console source code.

            3. Can I build the forms using JSF+Primefaces?  In that case, how do I associate the forms to the correspondent tasks?

            3'. How can I build the forms using JSF and Primefaces?

            In that case, how do I associate the forms to the correspondent tasks?

            Yes. In our project, we're using JSF + Primefaces + Primefaces Extension (Dynaform component) for TaskForm. To associate a form to the correspondent task, we use a predefined Node variable to store DynaFormID. That extra variable's value would be specific at the process designing time. All process are create/design/update using the Jbpm Web Designer via iframe. Drool-guvnor officially supports this. We event add some custom GUIs for selecting Actors (DynaFormID, GroupIDs etc..):integration-screenshot.png

            Then, In runtime, dynaform will be used for display and help user input data to Task input/output parameter maps just like jbpm-gwt-console does.

            4. If someone could point me to a good resource, wiki, forum post, book?

            IMHO, the official jbpm user-guide is the most valuable referrence resource. Mr. Mauricio Salatino (ah, Salaboy) has a wonderful book series: jBPM 5 Developer Guide , in the lastest edition, it has a dedicated chapter for Integration Tips. Sometime, the source-code is our last savior.

             

            I'm willing to write a detailed article describing this integration process in case someone is interested.

             

            Hope this helps,