4 Replies Latest reply on Jun 22, 2007 4:53 PM by avbentem

    Why is core:process-definitions considered a development too

      Apparently using core:process-definitions in components.xml is a developers tool:

      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=98430
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=90206

      The above threads describe that when using

      <components ....>
       <core:jbpm>
       <core:process-definitions>
       <value>jbpm/mytask/processdefinition.xml</value>
       </core:process-definitions>
       <core:pageflow-definitions></core:pageflow-definitions>
       </core:jbpm>
      </components>

      then org.jboss.seam.core.Jbpm#installProcessDefinitions() is called each time JBoss AS is started, and an additional copy of the definition is inserted into the database even when the deployed EAR has not changed. Note that jBPM is not to be expected to check for actual changes when deploying a process; in "it's the user's code that should call the jbpmContext.deployProcessDefinition()".

      But... why is this considered to be a development tool? Wouldn't using jBPM with Seam be much easier if there is a common way to deploy processes? If not using core:process-definitions then maybe by embedding the jBPM web-console's org.jbpm.webapp.servlet.ProcessUploadServlet (/jbpm-console/upload or /jbpm/deployprocess)?

      Just curious...

      Arjan.

        • 1. Re: Why is core:process-definitions considered a development

           

          "avbentem" wrote:
          an additional copy of the definition is inserted into the database even when the deployed EAR has not changed

          ...of course, when taking hibernate.cfg.xml from the DVD Store example then one must change the line
          <property name="hbm2ddl.auto">create-drop</property>

          into
          <property name="hbm2ddl.auto">update</property>

          to actually see that happen (and to save process instances between server restarts).

          Furthermore I've added a documentation issue to JIRA, referring to this very forum topic as for ideas about how to deploy process definitions after the development stage: http://jira.jboss.com/jira/browse/JBSEAM-1034 -- so: any ideas welcome!

          Arjan.

          • 2. Re: Why is core:process-definitions considered a development

            The problem is that we don't know whether the process definition in the application is the same as the one already in the database. Without this information, we would end up either creating duplicate process definitions (bad) or overwriting process changes made outside of the application. (worse) Really, the lifecycle of a process definition will likely not be exactly the same as your application deployment cycle.

            This is an area we would definitely like to see improved, as would the JBPM team.

            • 3. Re: Why is core:process-definitions considered a development

              I just noticed that Michael Yuan's book, JBoss Seam Simplicity and Power Beyond Java EE does not explain this issue either (page 265). So I feel it's really important to make this clear in the online documentation?

              Can anyone think of a good text to add at Installing process definitions? Like maybe

              We need to install jBPM:
              
               <core:jbpm />
              
              [BEWARE: is it indeed enough to just include an empty <core:jbpm> node?]
              
              We also need to tell jBPM where to find the business process definitions.
              The following will reload them into the jBPM database tables each time
              the application is started, and can be very helpful during development:
              
               <core:jbpm>
               <core:process-definitions>
               <value>todo.jpdl.xml</value>
               </core:process-definitions>
               </core:jbpm>
              
              See the jBPM documentation for examples on loading the process definitions
              into a production environment.

              If you have any ideas then please comment on JBSEAM-1034. Maybe the components.xml XSD can be annotated to make smart IDEs show a tooltip that could alert people...

              Thanks,
              Arjan.

              • 4. Re: Why is core:process-definitions considered a development

                > The following will reload [..] the application is started

                Better, I guess:

                We need to install jBPM:
                
                 <core:jbpm />
                
                [BEWARE: is it indeed enough to just include an empty <core:jbpm> node?]
                
                We also need to tell jBPM where to find the business process definitions.
                The following will add a new version of the process definition in the jBPM
                database tables each time the application server is started. This may be
                very useful during development, but for production environments refer to
                the jBPM documentation to only add a new version when the definitions
                are known to have actually changed.
                
                 <core:jbpm>
                 <core:process-definitions>
                 <value>todo.jpdl.xml</value>
                 </core:process-definitions>
                 </core:jbpm>