Delete DAM asset workflow | Community
Skip to main content
September 17, 2019

Delete DAM asset workflow

  • September 17, 2019
  • 2 replies
  • 17233 views

We have a requirement for workflow for approval on the deletion of a DAM asset.

The requirements are :  

The author should request for deletion of an asset.

Workflow should check

1. if Asset is not published

2. If the asset is referenced in any page

If both conditions are met, the "Librarian" group should able to receive the workflow request.

Once the Librarian approves the workflow, it should delete the asset, mail should be triggered to the initiator and super users

Once the Librarian rejects the workflow, it should not delete the asset, mail should be triggered to the initiator and super users

Workflow has been created with Dynamic Participant step for verification.

Launcher configuration has been made to initiate the workflow when Node is removed on DAM: asset node.

But the challenges are :

1. Finding assets references in 2000 pages in query is slowing performance.

2. When Author clicks on the delete button, it triggers workflow but also deletes the asset same time. So even if the workflow is rejected, assets are deleted.

So I need few inputs :

1. What is best way to check references without impacting performance?

2. Do we need to hide delete button ? and show "Request for deletion" for DAM assets ? if yes, how we can do that?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Adobe Employee
September 17, 2019

Check the following post:

Delete Dam Asset Workflow

Adobe Employee
September 18, 2019

To answer your questions:

1. Try to find the query that is getting triggered for calculating references and use the explain query[3] tool to find the index that query is using. Then try to optimize the index Or create a new index if its a traversal query.

2. Delete option is read from "/libs/dam/gui/content/assets/jcr:content/actions/selection/delete" , So, you can use sling resource merger(hide:resource) to hide the delete tab and add a new tab for request for deletion.

You can also, create a custom workflow step[2] and use the AssetReferenceSearch[1] to calculate the references.

[1] AssetReferenceSearch ("The Adobe AEM Quickstart and Web Application.")

[2] Adobe Experience Manager Help | Creating custom AEM workflow steps that send email messages

[3] http://<host>:<port>/libs/granite/operations/content/diagnosistools/queryPerformance.html

September 18, 2019

Thanks Jaideep.

1. I am able to hide delete button using sling merger but it is not showing new tab/button for "Request for Deletion".

2. How to call a workflow from this new button?

3. "backspace" is a shortcut for direct delete, will the new button need to override "backspace" shortcut key too?

September 19, 2019

DAM update asset workflow will not be triggered for Asset deletion.

One way is to write a simple workflow model. Create a process step which will check for the asset references or activation status.

If the asset is published or have any references you can send an email to the required users (ideally who started the workflow and any other admin user) and complete the workflow.

If it is not published or don't have any references, you can use the API to delete the asset and complete the workflow.

So, whenever an author would like to delete the asset, request him to trigger the custom workflow for the asset which will take care of the requirement.

Sample Workflow process can be found here:

AssetValidationWorkflow

September 19, 2019

Simple workflow model to trigger the above Asset Validation is available here

September 19, 2019

Thanks, dvnSudheer

I have created a workflow model by creating some dynamic steps and verify the "replicate" status of payload in dynamic participant steps.

The issue is: When I am triggering this workflow from the launcher, the asset is getting deleted even before completion of the workflow.

So as per suggestions above, I have hidden the "delete" button and trying to a new button "Request for deletion" and on this button, I am trying to initiate my workflow. I am not able to find the point or way to trigger the workflow from the button.