Hello everyone,
I'm looking to archive process instances that are currently active, paused, or paused due to an exception. We've already configured process instance archival after 5 days with deletion after 3 days, but we now have over 10,000 process instances in these states that we want to archive instead of deleting, as we may need them in the future.
Is there a script or another method we can use to archive these instances?
Thanks, Manish
Discussion posts and replies are publicly visible
Hi manishs0028,
You can create a process report using 'a!queryProcessAnalytics()' to get process instance Id(s) of all the instances in currently active, paused, or paused due to an exception status.
Create a utility process to cancel or archive all the above instances Id(s) using cancel process or archive process smart service respectively.
Harsh Kumar Agarwal : Thanks for your input , Can you provide me some example code, that will be helpful thanks.
Follow the screenshots to create Process Report:
After creation, edit the report.
Under Filter > Create New Rule
Save the changes. Using this report in a!queryProcessAnalytics() you can get the instance ids as suggested in previous message.
Harsh Kumar Agarwal :This report provides me with the process IDs, which I can readily obtain from the monitoring tabs. Essentially, the process report accomplishes the same task. However, the crucial issue is that I have over 10,000 process IDs that I aim to archive simultaneously. The archive smart service archives one process at a time.
You can run that smart service in a loop or in a MNI to do bulk operation.
The idea to use 'a!queryProcessAnalytics()' here so that you create a utility process and automate this activity and do not need to find id(s) manually. If you would like to get it from monitoring the you just need the process to cancel or archive.