Add property to DAM Asset metadata using custom workflow | Community
Skip to main content
jezwn
Level 5
Nov 30, 2019 5:41 PM UTC
Solved

Add property to DAM Asset metadata using custom workflow

How to access the metadata node to add additional property on DAM UPDATE ASSET using custom workflow?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Ravi_Pampana
Ravi_PampanaAccepted solution
New Participant
Dec 1, 2019 10:53 PM UTC

You can get required details like below

//Get session

Session session = workflowSession.getSession();

// Get the Workflow data (the data that is being passed through for this work item)

final WorkflowData workflowData = workItem.getWorkflowData();

// Get the path to the JCR resource from the payload

        final String payloadPath = workflowData.getPayload().toString();

        ResourceResolver resourceResolver = null;

        try {

            // Get the ResourceResolver from workflow session

            resourceResolver = getResourceResolver(workflowSession.getSession());

            Resource resource = resourceResolver.getResource(payloadPath);

            // Using resource, we can read/update/add properties to required node by adapting to node or iterating to the required node and save the node by using session

        }catch(Exception e){

        // Add appropriate logger statements for checking errors

        }

Hope this helps!

3 replies

Ravi_Pampana
Ravi_PampanaAccepted solution
New Participant
Dec 1, 2019 10:53 PM UTC

You can get required details like below

//Get session

Session session = workflowSession.getSession();

// Get the Workflow data (the data that is being passed through for this work item)

final WorkflowData workflowData = workItem.getWorkflowData();

// Get the path to the JCR resource from the payload

        final String payloadPath = workflowData.getPayload().toString();

        ResourceResolver resourceResolver = null;

        try {

            // Get the ResourceResolver from workflow session

            resourceResolver = getResourceResolver(workflowSession.getSession());

            Resource resource = resourceResolver.getResource(payloadPath);

            // Using resource, we can read/update/add properties to required node by adapting to node or iterating to the required node and save the node by using session

        }catch(Exception e){

        // Add appropriate logger statements for checking errors

        }

Hope this helps!

Translate
jezwn
jezwnAuthor
Level 5
Dec 1, 2019 4:23 AM UTC

I created a process, added it to DAM UPDATE ASSET and it's all working fine. What I'm troubling with is how to access the metadata node in the execute() method to add properties to it.

Translate
Ravi_Pampana
New Participant
Dec 1, 2019 2:37 AM UTC

Hi,

For adding custom properties to asset meta data, we need to add custom workflow process step to "Dam Update Asset" workflow.

Go to /libs/settings/workflow/models/dam/update_asset.html ,edit the workflow model ,add Process Step component and select your custom process step and save it.

For creating custom workflow, you can refer below

https://helpx.adobe.com/experience-manager/using/message_service_gateway_api_64.html

http://www.6dglobal.com/blog/creating-custom-CQ-workflow-process-step-2014-10-14

Translate