13 Replies Latest reply on Aug 13, 2009 9:10 AM by balazska
      • 1. Re: How to clean jbpm 3 database
        cash1981

        You need to be more specific than that.
        If you are wondering how you can drop all tables, then you can do a create-drop in your hibernate.cfg.xml


        Otherwize you can manually clean the values in the database, but I don't recommend that unless you know what you are doing.

        • 2. Re: How to clean jbpm 3 database
          balazska

          Hi!


          I want to clean only the ended processes and tasks records from jbpm db.
          These expired records remains the database, only the end date attribute will be filled with the actual date.


          • 3. Re: How to clean jbpm 3 database
            asookazian

            Are you using HSQLDB (default IIRC) or something else like MSSQL, Oracle, etc.?


            There may be a way to do this via the jmx-console if you find the right MBean...

            • 4. Re: How to clean jbpm 3 database
              cash1981

              I am not 100 percent certain of this, and please correct me, but I thought if you ended a process. ProcessInstance.end() or if you from a tasknode transit to end




              <task-node name="permit">
                   <task name="40-ruling" swimlane="handlingOfficer"></task>
                   <transition name="next" to="end"></transition>
              </task-node>
                   
              <end-state name="end"></end-state>



              Then it will automatically delete everything that the process has stored?


              If you have put something in the business process context and want to remove it, I think you can delete it like this:


              processInstance.getContextInstance().deleteVariable("someName");

              • 5. Re: How to clean jbpm 3 database
                balazska

                Hi!
                I use Postgres db, and I would like to do this automatical, avoid jmx managmanets.


                thanx for your answer.

                • 6. Re: How to clean jbpm 3 database
                  balazska

                  Hi!


                  If you see the jbpm database, you will see the records remains in the database.


                  Anythhing else, I use the below code line to ended the process:
                  BusinessProcess.instance().endTask(taskName);

                  • 7. Re: How to clean jbpm 3 database
                    cash1981

                    Yes you are right. The only thing that is different is the version number that is set to 1,2 or 3 depending on if the task or process is running, suspended or finished.


                    Looks like this is the behaviour of jbpm. I agree that it seems strange that these are not deleted. Maybe someone with jbpm knowledge can answer.


                    The reason why I think its strange why these aren't deleted is because you can never return back to a processinstance once it is ended, or a taskinstance for that matter. (am I right?)
                    But if only the version is set to something else, then definetly that should be possible.

                    • 8. Re: How to clean jbpm 3 database
                      balazska

                      But it possible it is ended the task but not the process instance.
                      I will see today this issue.


                      Thanx for your answers.

                      • 9. Re: How to clean jbpm 3 database
                        balazska

                        What kind of version do you think?

                        • 10. Re: How to clean jbpm 3 database
                          cash1981

                          The version attribute in JBPMPROCESSINSTANCE and JBPMTASKINSTANCE

                          • 11. Re: How to clean jbpm 3 database
                            cash1981

                            Can someone please clarify here.


                            processInstance.getContextInstance().deleteVariable("someName");



                            does not delete the someName variable in JBPM_VARIABLEINSTANCE. It only sets the TOKEN, TOKENVARIABLEMAP, PROCESSINSTANCE to null. Why isn't this deleted even though you ask to delete it?


                            Can someone please clarify?

                            • 12. Re: How to clean jbpm 3 database
                              balazska

                              I think this is a general jbpm concept.
                              The process instance is remained available, but the business object(someName) is deleted from db

                              • 13. Re: How to clean jbpm 3 database
                                balazska

                                Hi!


                                Can, you see this topic please:




                                http://seamframework.org/Community/PossibleJbpmBugMultipleJbpmbytearrayAndJbpmbyteblockRecordsCreationWhenTheProcessStart?cid=1566252





                                What's your opinion?
                                thx.