5 Replies Latest reply on Mar 18, 2009 1:28 PM by Ronald van Kuijk

    Seam and jBPM - designer produces package, in components.xml the file is referenced

    Bojan Kovacevic Newbie

      Hello everyone,


      I configured the seam environment as to the chapter 25.6. Configuring jBPM in Seam from reference manual - added bpm tag in components.xml that is :) (with appropriate values of course). The problem is that I get the error that says ERROR couldn't parse process definition.
      Instead of experimenting, I thought I could confirm something here. The eclipse plug-in (the designer) produces a package, while in components.xml it is a file (moreover with jpdl extension) that is referenced.
      The question is: How should I reference created package in components.xml?
      Does the error given can narrow down the search for problem? It seams pretty general.

        • 1. Re: Seam and jBPM - designer produces package, in components.xml the file is referenced
          Michael Wohlfart Expert

          as far as I understand the output from the designer tool the package consist of 3 files:



          • processimage.jpg: a picture of the process as seen in the designer




          • gpd.xml: some layout information about the positions of the nodes and edges of the process picture




          • processdefinition.xml: is probably the file you need in components.xml, the process definition itself




          I have just a stub for jbpm in components.xml and feed the whole file directly into the jbpmContext like this:




          ProcessDefinition pd = ProcessDefinition.parseParZipInputStream(zipStream);
          jbpmContext.deployProcessDefinition(pd);
          




          to make sure the tables are set up I use a postInitialization Observer:


          @Scope(STATELESS)
          @Name("jbpmSetup")
          public class JbpmSetup {
          
              @Logger
              Log log;
          
              @In(create = true)
              Jbpm jbpm;
          
              @Observer("org.jboss.seam.postInitialization")
              public void startup() {
                  try {
                      jbpm.startup();
                      JbpmConfiguration config = jbpm.getJbpmConfiguration();
                      JbpmContext context = config.createJbpmContext();
                      context.getSession().flush();
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          }
          



          I use this approach since there seems to be problems with process definitions being deployed multiple times on startup...

          • 2. Re: Seam and jBPM - designer produces package, in components.xml the file is referenced
            Bojan Kovacevic Newbie

            Thanks for your reply but that seams like workaround. When they built the designer as they built it, they surely must have had a vision of how should that package is to be used. Now, I am using designer version 3.1.3.GA shipped along with JBoss Tools 2.1.2. Seam version is 2.0.2. which has jbpm-jpdl-3.2.2.jar bundled.


            The question is: How should I reference created package in components.xml? - again, I am not going to experiment when I only need info about a thing that already works.


            every source I read on the topic says:



            <value>xyz.jpdl.xml</value>




            should be entered in components.xml

            • 3. Re: Seam and jBPM - designer produces package, in components.xml the file is referenced
              Paul Keogh Novice
              These are my notes from doing some jBPM experimentation;

              The BPM resources of;

                   hibernate.cfg.xml
                   jbpm.cfg.xml
                   BPM/*
                   
              must reside under the EarContent folder of the xxx-ear project.

              The process definition files are referenced from WebContent/WEB-INF/components.xml like;

                   <bpm:jbpm>
                        <bpm:process-definitions>
                             <value>BPM/checkout.jpdl.xml</value>
                        </bpm:process-definitions>
                        <bpm:pageflow-definitions />
                   </bpm:jbpm>

                   
              Expect obscure errors around XML parser failure if the files are not locatable.

              Hope this helps.
              • 4. Re: Seam and jBPM - designer produces package, in components.xml the file is referenced
                Michael Wohlfart Expert

                well, I don't see my approach as a workaround since:



                • my requirement is to deploy a new version of the process definition without  restarting the application, not sure how to do this with components.xml only





                but I am open for better ideas of course...

                • 5. Re: Seam and jBPM - designer produces package, in components.xml the file is referenced
                  Ronald van Kuijk Apprentice

                  Michael Wohlfart wrote on Mar 18, 2009 13:11:


                  well, I don't see my approach as a workaround since:


                  • my requirement is to deploy a new version of the process definition without  restarting the application, not sure how to do this with components.xml only





                  but I am open for better ideas of course...


                  You are completely right.