For example, consider a business requirement when a digital asset has to be archived prior to deleting it. That is, you want to place an asset into a trash folder before deleting it. Using out of the box workflow steps, you cannot achieve this use case. To achieve this requirement, you need to build a custom workflow step that moves the asset to a folder named trash under /content/dam.
The following illustration show the workflow model that moves a digial asset to the trash folder and then deletes the asset.
In this model, the step that moves the digital asset to the trash folder is a custom workflow step that uses AEM APIs. To create a custom workflow step for Experience Manager 6.3, you need to use Declarative Services annotations as opposed to Apache Felix - SCR Annotations (this is shown in this article).
This development article uses these APIs to achieve this use case:
- Workflow API - to handle the payload that represents the digital asset
- JCR API - to get the node and read the jcr:data property to obtain an InputStream
- AssetManager API - to place the asset into the Trash folder.
To read this development article, click https://helpx.adobe.com/experience-manager/using/modify_asset_workflow.html.