On Asset deletion, how to get its properties before its deleted. | Community
Skip to main content
Level 2
December 15, 2022
Solved

On Asset deletion, how to get its properties before its deleted.

  • December 15, 2022
  • 3 replies
  • 954 views

Hi,

On deletion of an Asset, I need get a property from the Node.

 

I created a workflow and also a launcher which is triggered whenever a node is removed. From the workflow payload I need to get asset path from which I can get its properties just before deletion(manually deletion of asset not from the process step)  but how?

 

thanks

Nandan

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

@nandango1 : 

Once the asset is deleted, properties are unavailable. 

Few other approaches:

  • Create a custom workflows, that fetches properties, use as necessary and then delete asset
  • Overlay Delete button or create a new one. It can call a custom servlet, which first fetches necessary info and then deletes asset

3 replies

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
December 15, 2022

@nandango1 : 

Once the asset is deleted, properties are unavailable. 

Few other approaches:

  • Create a custom workflows, that fetches properties, use as necessary and then delete asset
  • Overlay Delete button or create a new one. It can call a custom servlet, which first fetches necessary info and then deletes asset
Aanchal Sikka
arunpatidar
Community Advisor
Community Advisor
December 15, 2022

I think, you can use event listener as well to read properties before it is deleted

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/TitlePropertyListener.java 

Arun Patidar
Mani_kumar_
Community Advisor
Community Advisor
December 15, 2022

You can utilize the event listener to get the properties and if not write custom logic for deletion of the asset, get the properties and then delete the asset.