8 Replies Latest reply on May 20, 2010 1:41 AM by rebody

    JBPM-2856 delete sub process instance after it ends

    rebody

      Hi guys,

       

      It seems the sub proces instance won't be deleted after the sub-process ends.  So I want to delete sub process instance after it ends.  Any other ideas?

       

      Please reference this issue.

       

      https://jira.jboss.org/jira/browse/JBPM-2856

        • 1. Re: JBPM-2856 delete sub process instance after it ends
          swiderski.maciej

          Hi,

           

          I just took a look at your patch and I am not completely sure we should solve it like this.

           

          In general deleteProcessInstance method of DBSession should take care of deleting remaining subprocess instances. But the problem is in SubProcessActivity that within signal methods is resetting subProcessInstance field.

          Simple comment that line will make execution being properly removed.

           

          What do you think about it?

           

          Cheers,

          Maciej

          • 2. Re: JBPM-2856 delete sub process instance after it ends
            rebody

            Hi Maciej,

             

            Thank you for reviewing my patch.

             

            But I am not clear what you point to.  In the signal() in SubProcessActivity, it has to get related subProcessInstance first, and cancel the bid-relationship between superProcessInstance and subProcessInstance, otherwise we can't delete subprocessInstance directly,  Database will throw a FK related exception.  Do you mean this?

             

            And you said 'deleteProcessInstance method of DBSession should take care of deleting  remaining subprocess instances',  do you mean that we needn't delete the sub processInstance after SubProcessActivity signaled, but could leave them alive until the end of superProcessInstance ended, so the deleteProcessInstance could delete them all?

             

            If you could show more details, it will be very appreciate.  Thank you once again.

            • 3. Re: JBPM-2856 delete sub process instance after it ends
              swiderski.maciej

              Hi,

               

              HuiSheng Xu wrote:

              And you said 'deleteProcessInstance method of DBSession should take care of deleting  remaining subprocess instances',  do you mean that we needn't delete the sub processInstance after SubProcessActivity signaled, but could leave them alive until the end of superProcessInstance ended, so the deleteProcessInstance could delete them all?

              Yes, this is pretty much what I was saying.

               

              Please review attached patches (providing two options):

              opt1 - utilizes end method of ExecutionImpl to clean up

              opt2 - removes reset of subProcessInstance in signal method of SubProcessActivity

               

              HuiSheng Xu wrote:

               

               

              But I am not clear what you point to.  In the signal() in SubProcessActivity, it has to get related subProcessInstance first, and cancel the bid-relationship between superProcessInstance and subProcessInstance, otherwise we can't delete subprocessInstance directly,  Database will throw a FK related exception.  Do you mean this?

              I have not experienced any problems with db constraint violations. But I agree that if that will pop up that solution is not an option any more.

               

              Please review the patches and let me know your comments.

               

              P.S.

              I tried to upload them to jira but seems like it is not fully available at the moment, upgrade is on its wa.

               

              Cheers,

              Maciej

              • 4. Re: JBPM-2856 delete sub process instance after it ends
                rebody

                Hi Maciej,

                 

                I love the first option very much.  Thank you for your job.  It is wonderful.  I create some more testcase and all of them could pass.

                 

                If no one disagree, I will commit this patch and resolve the issue.

                • 5. Re: JBPM-2856 delete sub process instance after it ends
                  swiderski.maciej

                  Hi,

                   

                  glad you liked it.

                   

                  Please attach your complete patch to jira as soon as it will be possible just for keeping the record.

                   

                  Keep up the good work

                  Maciej

                  • 6. Re: JBPM-2856 delete sub process instance after it ends
                    rebody

                    Hi Maciej,

                     

                    Cannot upload any attaches to JIRA.  Still tell me that I have no authority to do that.

                     

                    And the new JIRA is too slow to use.  I don't understand why they must upgrade to JIRA 4 at this time.

                    • 7. Re: JBPM-2856 delete sub process instance after it ends
                      swiderski.maciej

                      Hi,

                       

                      just so you know, jira is working fine now. You can upload the patch whenever you have a minute.

                       

                      Cheers,

                      Maciej

                      • 8. Re: JBPM-2856 delete sub process instance after it ends
                        rebody

                        Hi Maciej,

                         

                        Just upload patch. Thank you for noticing.

                         

                        If there is no objection, I will commit it to the svn repository.