Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

ACS Commons Workflow Purge

Avatar

Level 2

I am trying to setup an OSGi config for workflow purge activities as mentioned in 

https://adobe-consulting-services.github.io/acs-aem-commons/features/workflow-remover/index.html

 

How do I setup the OSGi configuration such that it purges workflow instances which are in completed state for more than 60 days. workflow.older-than property does not seem to work like that but it takes specific date as input. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @RonnieForum,

If you are looking for purge based on days old, you can make use of OOB Workflow Purge

Tools -> Operations -> Maintenance -> Weekly Maintenance window -> Workflow Purge -> Configure

Vijayalakshmi_S_0-1598968841929.png

 

View solution in original post

21 Replies

Avatar

Correct answer by
Community Advisor

Hi @RonnieForum,

If you are looking for purge based on days old, you can make use of OOB Workflow Purge

Tools -> Operations -> Maintenance -> Weekly Maintenance window -> Workflow Purge -> Configure

Vijayalakshmi_S_0-1598968841929.png

 

Avatar

Level 2
Thanks @Vijayalakshmi_S. However, how do I make the Workflow Purge task under Maintenance code driven ? I can make OSGi config code driven but would need to add the Workflow Purge Task manually to all the environments till production ?

Avatar

Community Advisor

Hi @RonnieForum,

Sorry, missed this thread.

Purge configuration can be set up as OSGI config and that can be part of code base. As it is a factory config, you can create config in the name of PID with identifier.

This task is already part of Weekly Maintenance Window OOB - You can check this at Tools -> Operations -> Maintenance -> Weekly Maintenance Task -> Workflow Purge (Will display the execution status of last executed run with date and when it will be next executed)

Explicit execution outside this window can be triggered by means of "Run" option on the card display (as you hover)

Avatar

Level 2

@Vijayalakshmi_S: I got the point around OSGi config . My question was around how to create the workflow purge task under weekly maintenance. Currently one of the lower environment shows below setup in my case. There is no item. How do I add Workflow Purge item here via code so that I don't have to manually add them in each environments. 

 

MaintenanceTask.jpg

Avatar

Community Advisor

Hi @RonnieForum,

It should be available OOB. Could you please let know the AEM instance version you are using.

Given that you don't have per the screenshot shared, you can add using "Add" actions in top left -> Add Task model -> Choose the task (in this case, workflow purge)

In repository, this will get saved in below path. 

  • /libs/settings/granite/operations/maintenance/granite_weekly

It is a one time activity and need not be part of code deployment.

If you are still looking for adding it as code outside your project code base, then add task in your local -> overlay to /apps -> Take a package out of it and deploy across. 

 

Avatar

Level 2

@Vijayalakshmi_S I am using OOTB workflow purge as you suggested. However, I am seeing that there is already an existing scheduler which looks for all workflow instances in completed state for all models which are 30 days old. My configuration looks for specific models and which are 60 days old. 

 

From logs I can see that the other existing scheduler executes always. How do I make the Maintenance weekly scheduler to use my custom config rather than the existing one. 

Avatar

Community Advisor
As it is a factory config, it will execute all instances of purge configuration. Can you check the available instances of purge configuration in OSGI configuration console and confirm your custom entry is available as part of the same.

Avatar

Level 2
Yes, it's already there but is there a way to execute only the custom one and ignore / disable the other instances ?

Avatar

Community Advisor
If it is a custom factory service, we can reference or make use of specific instance/implementation. OOTB factory service respects all instance/implementations.

Avatar

Level 2

@Vijayalakshmi_S @kautuk_sahni

 

Is it possible to have the workflow instances records after they are purged for audit purpose ? 

Avatar

Community Advisor
You mean to have a track of purged workflow instances?

Avatar

Level 2

No, the workflow instance itself as in its history of steps, any metadata etc. 

Avatar

Community Advisor
I don't think we have traces of workflow instances once it is purged. Could you please elaborate your use case if am deviating.

Avatar

Level 2
Business is asking that workflow instance stays in system for 90 days and purged post that. After purging if they want to check what was metadata and other info of that instance, is it possible to retrieve ?

Avatar

Community Advisor
With the desired purge configuration, we are removing/purging the workflow instances completely. Hence no trace of its related metadata would be available once it is purged.

Avatar

Employee Advisor

@RonnieForum  Instead of using workflow remover, you can leverage workflow purge oob for your purpose

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/re-acs-commons-workflow-pu...

here you will provide days in configurations "scheduledpurge.daysold"