Exception when deleting/canceling an activiti process instance

cancel
Showing results for 
Search instead for 
Did you mean: 
emadhusam
Customer

Exception when deleting/canceling an activiti process instance

Hi, 

I am using Alfresco One Enterprise with activiti.

I created and published a couple of activity apps. 

The apps includes some processes with javascript actions. When I started an instance of the processes I figured out that there are some errors in the scripts so I corrected the processes published the apps and started new instance and they are working fine now.

The issue is that the instances which had problems in the scripts created some exceptions and could not complete. when I am trying to cancel or delete them form the activiti web interface or from activiti admin I am getting exceptions.

How I can delete these instances?

not able to deleting them will now prevent the deletion of the app they were part of

I will attache the exceptions

Thanks 

4 Replies
jose_leon_coupa
Active Member II

Re: Exception when deleting/canceling an activiti process instance

Hi @emadhusam ,

 

Have you found a solution to this problem? I have a similar situation and I'm looking for a solution. Thanks!

emadhusam
Customer

Re: Exception when deleting/canceling an activiti process instance

Hello,

You have to delete the processes from the database first.

whereas you have to replace X with the instance ID of the problematic instance:

delete from ACT_EVT_LOG where proc_inst_id_ = 'X';
delete from ACT_RU_JOB where process_instance_id_ in (select id_ from ACT_RU_EXECUTION where proc_inst_id_ = 'X');
delete from ACT_RU_VARIABLE where proc_inst_id_ in (select id_ from ACT_RU_EXECUTION where proc_inst_id_ = 'X');
delete from ACT_GE_BYTEARRAY where id_ in (select id_ from ACT_RU_VARIABLE where proc_inst_id_ = 'X');
delete from ACT_RU_EVENT_SUBSCR where proc_inst_id_ = 'X';
delete from ACT_RU_IDENTITYLINK where proc_inst_id_ = 'X';
delete from ACT_RU_TASK where proc_inst_id_ = 'X';

// Take the parent_id into account for subprocesses
delete from ACT_RU_EXECUTION where parent_id_ = 'X';
delete from ACT_RU_EXECUTION where proc_inst_id_ = 'X' or id_ = 'X';
delete from ACT_HI_ACTINST where proc_inst_id_ = 'X' or execution_id_ = 'X';
delete from ACT_HI_PROCINST where proc_inst_id_ = 'X' or id_ = 'X';
delete from ACT_HI_TASKINST where proc_inst_id_ = 'X' or id_ = 'X';
delete from ACT_HI_VARINST where proc_inst_id_ = 'X' or execution_id_ = 'X';
delete from ACT_HI_DETAIL where proc_inst_id_ = 'X' or execution_id_ = 'X';
delete from ACT_HI_IDENTITYLINK where proc_inst_id_ ='X';

jose_leon_coupa
Active Member II

Re: Exception when deleting/canceling an activiti process instance

Thank you @emadhusam !

emadhusam
Customer

Re: Exception when deleting/canceling an activiti process instance

You are welcome.