3 Replies Latest reply on Dec 7, 2005 5:34 PM by koen.aers

    WebSale Example: When does the INSERT INTO JBPM_(tableName)

    paz

      I have the starter kit running "as is" with default config using the Hypsersonic java DB. Studying the implementation. I know Hibernate is the persistent layer. I can see in my \JBPM\jbpm-server\jbpm\data\hypersonic\loadDBscript
      my insert statements after running throught the web app from start state to end state.

      Example: INSERT INTO JBPM_VARIABLEINSTANCE VALUES(........)

      These are the insert statements that are generated after cookie monster, or ernie, or bert "Save and Close Task" Task Name "create new web sale order".
      I can understand the flow, lets say, from the processdefinition but I can not figure out how the Task Name "create new web sale order" knows to "INSERT INTO JBPM_VARIABLEINSTANCE". I can not find a class, a script, a nothing?

      How does Task Name "create new web sale order" know to insert into
      JBPM_VARIABLEINSTANCE?

      Maybe because I am new to Hibernate but when does the actual "insert statement" get implemented and where is that statement if I wanted to insert additional values into the table.

      Thanks for the guidance.

        • 1. Re: WebSale Example: When does the INSERT INTO JBPM_(tableNa
          koen.aers

          This mystery will be solved if you dig into the sources of jBPM and look at the Hibernate mapping files in the org.jbpm.context.exe and the org.jbpm.context.exe.variableinstance packages. These are the files (with extension *.hbm.xml) that specify how Hibernate has to treat the jBPM objects when storing them in a database. But a prerequisite of understanding all this is familiarity with Hibernate, so you might want to read the Hibernate docs also.

          Regards,
          Koen

          • 2. Re: WebSale Example: When does the INSERT INTO JBPM_(tableNa
            paz

            Thanks Very Much Koen,

            That was very nice guidance. Thank you very much for taking your time and providing me with the information.

            So Hibernate handles the task of mapping classes to tables, and objects to actual rows. Hibernate generates SQL for you (cool), relieves you from manual result set handling and object conversion and keeps your application portable to all SQL databases.


            Go hibernate..

            L8ski

            • 3. Re: WebSale Example: When does the INSERT INTO JBPM_(tableNa
              koen.aers

              Hibernate rocks indeed ;-)

              Cheers,
              Koen