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?
How to access the metadata node to add additional property on DAM UPDATE ASSET using custom workflow?
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!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.