Populate Metadata Field Values from /var
I have a custom metadata schema applied to my assets. A workflow creates replication metadata nodes under /var/abc/replication-data/{articleId}/{version}, where:
articleIdis derived fromjcr:content/metadataversionis derived fromjcr:baseVersion
Each version node contains properties such as replication-action (for example, Publish or Unpublish).
I have a metadata field named Publishing Action in my custom metadata schema. When a user opens the asset properties page, I want this field to dynamically resolve the asset's articleId and current version, locate the corresponding node under /var/abc/replication-data/{articleId}/{version}, retrieve the value of the replication-action property, and display it in the Publishing Action field.
What is the recommended approach in AEM to dynamically populate a metadata schema field using data stored in /var based on asset-specific metadata and version information?