8 Replies Latest reply on Oct 4, 2005 11:29 AM by sudhakartv

    Do you recommend to use struts with jbpm?

    kukeltje

      I'm sure people are useing it together. In fact the webui from 2.0 used struts. 3.0 uses the tiles facility.

      The api from jBPM is not that difficult if you look at the examples/testcases. Embedding it somewhere in a struts actionhandler would not be to difficult. I bet someone has done it before.

        • 1. Re: Do you recommend to use struts with jbpm?
          jgerlach

          I have converted the 3.0 JSF app into a Struts app. I will try to make get a Wiki entry together soon.

          The concepts of the JSF versus the Struts views are similar. Your action classes use the form data to decide what to do and delegate all the JBPM work to beans. The action classes have no JBPM imports and the beans have no Struts/Servlet imports.

          For example,
          An action class stores a "userBean" in request/session scope and the jsp can then use

          <fieldset>
           <legend>User Info</legend>
           <logic:present name="userBean">
           You are logged in as <c:out value="${userBean.userName}"/><br/>
           You are a member of the following group(s):
           <logic:iterate id="memberelement" name="userBean" property="userMemberships" >
           <bean:write name="memberelement" property="group.name"/>
           </logic:iterate>
           <br/>
           Other users in your groups are:
           <logic:iterate id="othermember" name="userBean" property="otherGroupUsers" >
           <bean:write name="othermember" property="name"/>
           </logic:iterate>
           </logic:present>
           <logic:notPresent name="userBean">
           You are not logged in.
           </logic:notPresent>
           </fieldset>
          

          to retrieve information from the JBPM engine.

          Since the work I'm doing if for a general purpose process app, I am not able to use the Struts Validation framework, DynaForms, or even plain FormBeans since those things require design time knowledge of the form elements.

          In order to deal with multiple people adding new processes, I have had to code all the validation based on the runtime values retrieved from variableAccess.

          • 2. Re: Do you recommend to use struts with jbpm?
            kukeltje

            @jgerlag:

            what would you think of an xforms enabled forms engine?

            • 3. Re: Do you recommend to use struts with jbpm?
              jgerlach

              I've played with XForms a bit, but nothing at the professional level so I'm speaking from ideas not experience.

              My initial thought is it would be a nice addition, especially if the xforms structure could be sent dynamically.

              I might want to create the xform document using a "select1" element and the content of that element would be populated with data from another page/action. If the structure can be built at runtime and sent to the form engine, I'd be good to go.

              It might introduce an added complexity since XForms isn't the defacto standard for web apps.

              James

              • 4. Re: Do you recommend to use struts with jbpm?

                 

                "jgerlach" wrote:
                I have converted the 3.0 JSF app into a Struts app. I will try to make get a Wiki entry together soon.


                Have you had a chance to do this yet? I haven't used JSF and all our presentation is done with Struts so this would be extremely useful for me.

                • 5. Re: Do you recommend to use struts with jbpm?
                  sak

                   

                  "jgerlach" wrote:
                  I have converted the 3.0 JSF app into a Struts app. I will try to make get a Wiki entry together soon.


                  It would be really great if you have a chance to do the same... Many must be awaiting your post at wiki....

                  • 6. Re: Do you recommend to use struts with jbpm?
                    preitsma

                     

                    "jgerlach" wrote:
                    I have converted the 3.0 JSF app into a Struts app. I will try to make get a Wiki entry together soon.


                    Will you be doing this soon ? It would be much appreciated.
                    A starting point based on good old Struts would be more instructive for those who are JSF newbies as well, like me.


                    • 7. Re: Do you recommend to use struts with jbpm?

                      Had to figure it out for myself and thought I'd contribute this:

                      http://wiki.jboss.org/wiki/Wiki.jsp?page=ShortStrutsTutorial

                      • 8. Re: Do you recommend to use struts with jbpm?
                        sudhakartv

                        Could you publish a war file on the same wiki page?

                        Thanks
                        -Sudhakar