Skip to main content

When cancelling a process instance which is currently at an activity in the workflow, is it best to just finish the worklist item and ensure the line rule doesn't route it to any other activity or call the K2Manager.DeleteProcessInstances for a selected process instance and not delete the log entries.


Are there any other ways of doing this?


Do both options result in the same thing happening in K2 or are statuses different, etc


 


Thanks


 

Hi,


You've got a couple of options - depending on what exactly you want to happen when 'cancelling a process instance'


Everything happens through K2.net Service Manager


1.  You can 'STOP' the process instance


This is merely a status change and all records pertaining to the process instance will stay in the K2 transaction database.  Use this option if you may need to 'START' the same process instance later on.


2.  You can 'GOTO' the last activity in the process definition


Unfortunately your process needs to be designed with a 'dummy' last Activity and Event so that nothing important happens in this Activity/Event.  This will finish the process instance and move all relevant information from the K2 database to the K2Log database.


3.  You can 'DELETE' the process instance.


This will remove all records pertaining to the process instance from the K2 transaction database and change the status of the process instance to 'Deleted' in the K2Log reporting database.


 


"is it best to just finish the worklist item and ensure the line rule doesn't route it to any other activity" - if you can do this, it is also a viable option - the process instance should Finish and it should be moved from transaction to reporting database.


 


HTH,


Ockert


Is there a way to call the Delete item (no log) from K2 Studio?

Meaning from the K2Studio application itself? - No


or


from within a process instance design, deleting the current or another process instance? - The current process instance, definitely not.  Deleting another process instance - many ways to kill a cat but definitely not advisable.


Regards,


Ockert


Reply