Hi mcawesomept
The short anser would be no it's currently not possible to delete a completed process instances, these completed instances are logged to the K2ServerLog db table for historical/reporting purposes and you cannot delete them individually.
It would be recommened to log a support ticket and have a support engineer assist you in having these process instances removed if you wish.
A feature request was logged for this which you can place a vote for:
https://ideas.k2.com/ideas/APIT-I-896
-Sello
Hi,
This is not exactly what you are looking for, but might help.
K2 workflow instances bloats the database over the period of time and at some point you would want to delete the old workflow instance which are completed or in error status.
Unfortunately, there is no way to delete specific instances of workflow, in other words, you could not select specific instance and delete it.
However, you can delete then in a bulk.
For instance, you would want to delete old workflow instances, which are completed and occupying the significant space in database, Instances on which you are not giong to report in future or you just want to delete them as a part of clean up activity.
You can follow below steps to do so.
- If you have 4.7 vision installed you can go to management workspace. For older version, you can follow similar steps
- Expand workflow server node.
- Go to your category to find workflow for which you want to delete workflow instances.
- Click on versions.
- Select version you want to delete.
- Check “Delete all historical (log) data for selected versions”
If I recall it does not allow delete process version if there are active instances.
The code is there in the archive script (which deletes from various of tables).
Out of box it just archives all processes based on date and not specific process or instance.
K2 could easily modify that script to ad more filter. I have been waiting for this for 10 years.
Hi,
We had the same issue with the k2 instance we have earlier . As we dont want to execute the scripts in K2 DB we are using the k2 archive feature.
We have K2 API already available for doing this. if you want to have the powershell version of the same. Refer the attached text file.
FYI.. this archival will move the instances(both active and completed) to a different DB.
Hi
There is stored procedure called serverlog.sogetprocessinstances. If you pass the full processname to this sp it will get you a list of processinstanceid's. Now just do a while loop and execute the serverlog.lprocinstremove method for each processinstanceid that is returned.
If this article is helpful please dont forget to mark it as KUDOS and solution or KUDOS only
K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum
Regards
Elvis
Hi @mcawesomept,
Completed process instances are logged to the K2ServerLog database for historical and reporting purposes, unfortunately there is no user friendly way to delete the individual completed process instances.
It is however possible to delete a specific version of a process definition and all of the historical data for that version of
the process definition using Workspace. However, please note that this will delete all process instances associated with the version of the process definition that is deleted, including Active instances etc.
That said, I suggested you take a look at this functionality in the development environment before using it in production.
I hope this answers your question, should you find the above information useful to your problem please Mark as "Accepted Solution and/ Kudo"
Thank you.
K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member
Good day mcawesomept
I understand your frustration. Sadly there is no clear and concrete answer to this problem. I do however have a suggestion that can solve your problem. See the steps listed below:
1. Navigate to management.
2. Expand the workflow server category
3. Click on the workflows category.
4. Click on the instances tab and now you should see your instances.
I sincerely hope this reply will answer your question.
If this post helped you to solve your problem and answer your question, Please remember to mark it as a Kudo/Solution.
Kind Regards
Jacques
[K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member]