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
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!
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.
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...
> 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>