4 Replies Latest reply on Aug 16, 2011 5:59 AM by roxy1987

    Changing jBPM 5 Db

    roxy1987

      Hi,

       

      I tried changing the backend by making changes to the files->

       

      /jbpm-installer/db/hibernate.cfg.xml,

      /jbpm-installer/db/persistence.xml,

      /jbpm-installer/db/testDS1-ds.xml.

       

      After that I run ant install.demo. So this created some 4 tables in the database viz.

       

      ProcessInstanceInfo,

      WorkItemInfo,

      SessionInfo,

      EventTypes.

       

      Which should mean that the database migration is successful. But these tables are not getting updated after I execute a process. No entries at all.

      Anywhere else I need to make changes?

       

      Regards.

        • 1. Re: Changing jBPM 5 Db
          marco.rietveld

          Hi Roxy,

           

          Which database are you using?

           

          It might have to do with transaction support (at the JDBC jar level) for the database: I've encountered a couple problems with that.

           

          Thanks,

          Marco

          • 2. Re: Changing jBPM 5 Db
            roxy1987

            Hi Marco,

             

            Thanks for replying. I am using MySQL.

            For now I am kind of exploring jbpm 5. My only objective of changing the db for now is to see the backend structure. But i think it aint as distinguishable and structured as jbpm 4.

            I tried to invoke the db manager through jmx-console. But I am not very sure whether the connection I see there is correct. But there must be a better way of checking out the h2 manager. Can you help me with that? or with the migration. Thanks again

             

            Regards.

            • 3. Re: Changing jBPM 5 Db
              marco.rietveld

              Hi Roxy,

               

              I think it has to do with how you're executing the process -- I ended up doing the following in order to look at the table structure:

               

              1. git clone jbpm ...
              2. modify files in jbpm-installer/db (which I actually ended up not using)
              3. ant install.demo
              4. ant start.demo
              5. git clone git://github.com/Salaboy/Drools_jBPM5-Training-Examples.git
              6. import and modify example 04 in demo eclipse to use MySQL
                1. mvn eclipse:eclipse (maven 3, of course)
                2. Modify persistence.xml so that it has the following properties:

                  <properties>

                              <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

                              <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>

                              <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/jbpm5" />

                              <property name="hibernate.connection.username" value="jbpm5" />

                              <property name="hibernate.connection.password" value="jbpm5"/>

                  ...

                3. Attach MySQL driver to project (via build path in Eclipse)
              7. Run example (PersistentEmergencyProcessTest jUnit test.)

               

              The problem I started noticing with the demo is that the jbpm-gwt-console-server.war that's deployed to the demo jBoss server that's started up has it's own (for H2) configured JPA configuration (persistence.xml).

               

              Salaboy's persistence example only modifies the SessionInfo table, but I think that if you extend it more, it'll be possible to to get a good idea of what's modified in the database.

               

              I think that getting the demo to work fully with the database is basically more work than is worth it -- especially if you're just exploring jBPM 5 at the moment.

              1 of 1 people found this helpful
              • 4. Re: Changing jBPM 5 Db
                roxy1987

                Hey Marco,

                 

                This is helpful.. Thanks a lot.