Expand my Community achievements bar.

SOLVED

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

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@nandan123 : 

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

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

@nandan123 : 

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

Avatar

Community Advisor

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

Avatar

Community Advisor

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.