Automating asset expiry based on multiple license expiry dates in Adobe Experience Manager Assets

This article explains how to manage asset expiration in Adobe Experience Manager (AEM) Assets when assets are governed by multiple license expiry dates. It describes manual and custom automation approaches for setting the asset expiration date.

Description description

Environment

Adobe Experience Manager Assets (all deployment models)

Issue/Symptoms

Organizations managing digital assets may need to enforce asset expiry based on the earliest of several license expiry dates, such as Model, Music, and Stock licenses. The standard pur:expirationDate metadata field controls asset expiry in AEM Assets, but there may be a requirement to automatically set this field to the earliest of several custom license expiry dates. Out-of-the-box, AEM does not provide automation to calculate and populate pur:expirationDate from multiple custom date fields.

  • Separate metadata fields are created for each license type, such as Model, Music, and Stock license expiry dates.
  • Assets should expire when the earliest of these dates is reached.
  • The pur:expirationDate field must be manually updated to reflect the earliest date; otherwise, asset expiry isn’t triggered as intended.
  • Expired assets should remain visible but unavailable for download, as configured in Content Hub settings.

Cause

AEM Assets doesn’t provide built-in functionality to automatically calculate the earliest date from multiple custom metadata fields and set it as the asset’s expiration date. Custom development is required for automation.

Resolution resolution

Follow these steps to resolve the issue:

Manual update approach

  1. Create separate date metadata fields for each license type, such as Model, Music, and Stock, in the asset metadata schema.

  2. Continue using the standard pur:expirationDate field to control asset expiry.

  3. When updating asset metadata, manually set pur:expirationDate to the earliest of the license expiry dates.

  4. In Content Hub, configure asset visibility so that expired assets remain visible but can’t be downloaded:

    • Go to Configurations > Asset Visibility.
    • Enable Allow users to view expired assets.
    • Leave Allow users to download expired assets disabled.

Custom automation approach

This approach requires development resources.

  1. Develop a custom workflow or script that:

    • Reads the Model, Music, and Stock license expiry date fields from the asset metadata.
    • Compares the dates and determines the earliest value.
    • Sets pur:expirationDate to the earliest date.
  2. Use the following logic for a custom workflow process step:

    • Retrieve the values of the three license expiry date fields from the asset metadata.
    • Compare the dates and identify the earliest one.
    • Update pur:expirationDate with the earliest date.
  3. Deploy and test the workflow or script to ensure pur:expirationDate is updated automatically whenever the license expiry fields are modified.

Verification

Confirm that assets expire as expected when the earliest license expiry date is reached and that expired assets remain visible but can’t be downloaded.

recommendation-more-help
experience-cloud-kcs-help-kbarticles