AEM Inbox | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by AsifChowdhury

The Correct approach to achieve this requirement, while adding a custom column, we need to query the workflow instance location where the comments are stored. Then we can add the value to the additional column. Here is the code snippet:

Resource resource = resourceResolver.getResource(resourcePath); if(resource != null) { Resource metadata = resource.getChild("metaData"); if(metadata != null) { ValueMap valueMap = metadata.getValueMap(); if(valueMap.containsKey("comment")){ workflowMetadata.put("comment", valueMap.get("comment", String.class)); } } }

2 replies

AsifChowdhury
AsifChowdhuryAuthorAccepted solution
New Participant
January 12, 2024

The Correct approach to achieve this requirement, while adding a custom column, we need to query the workflow instance location where the comments are stored. Then we can add the value to the additional column. Here is the code snippet:

Resource resource = resourceResolver.getResource(resourcePath); if(resource != null) { Resource metadata = resource.getChild("metaData"); if(metadata != null) { ValueMap valueMap = metadata.getValueMap(); if(valueMap.containsKey("comment")){ workflowMetadata.put("comment", valueMap.get("comment", String.class)); } } }
ChitraMadan
New Participant
January 4, 2024
AsifChowdhury
New Participant
January 4, 2024

Hi @chitramadan , I have seen this article already. This is only allows to grab those fields which are available in the workflow metadata. But what I am asking that is not available in the workflow metaDataMap. So this will not work.