cancel
Showing results for 
Search instead for 
Did you mean: 

CleanUp ACT_RU_* tables by hand

chimera
Champ in-the-making
Champ in-the-making
Hi

I overtook a project and upgraded to 5.16.4. I also noticed that the deleteProcessInstance method was never triggered by the previous developers at the end of a process. Thus the ACT_RU_* became fairly heavy.

I added that single-liner to the code, which is good, but of course still have all the legacy process run-time data. Deleting it, is tricky due to the numerous self-referencing foreign keys. Since this software is at Version 5.16.4 I'm certainly not the only one who is looking to compile such a SQL script. Of course, I know the executions to delete since I know the business key.

Anyone did compile that SQL Script before? Any default scripts from the Activiti Developers?

thanks

http://activiti.org/javadocs/org/activiti/engine/RuntimeService.html#deleteProcessInstance(java.lang.String, java.lang.String)
5 REPLIES 5

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I would not delete anything from the runtime tables. There is no need to delete process instance by deleteProcessInstance{/code] method. Activiti stores runtime data in RU tables. When process is finished there is no record in the RU tables.

Regards
Martin

chimera
Champ in-the-making
Champ in-the-making
Ok. So that is done automatically if the process ends. Making sense. Besides the programm/process logic treatment, is there still a SQL script to delete interrupted or failed process execution data that is no longer required? In particular for Integration or any testing environment that would be helpful.

@Martin, I think we need to bump for a beer. You are working just around the corner from my working location Smiley Happy

trademak
Star Contributor
Star Contributor
We don't have such a script.
We do have a way to cleanup the whole database for our unit tests, but I don't know if that's what you are looking for.

Best regards,

chimera
Champ in-the-making
Champ in-the-making
Presumably a subset of this cleanup is what we are looking for. Is that accessible on versioning system? Thank you.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Chimera,

is there still a SQL script to delete interrupted or failed process execution data that is no longer required?

SQL script no. There is API in the RuntimeService.

  /**
   * Delete an existing runtime process instance.
   *
   * @param processInstanceId
   *          id of process instance to delete, cannot be null.
   * @param deleteReason
   *          reason for deleting, can be null.
   * @throws ActivitiObjectNotFoundException
   *           when no process instance is found with the given id.
   */
  void deleteProcessInstance(String processInstanceId, String deleteReason);

Beer: yes sure next time when I'll be in Bern.

Regards
Martin
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.