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.
AsifChowdhury
AsifChowdhuryAccepted solution
Community Advisor
Jan 12, 2024 10:07 AM UTC

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)); } } }

3 replies

ChitraMadan
Community Advisor
Community Advisor
Jan 4, 2024 3:19 PM UTC
AsifChowdhury
Community Advisor
Community Advisor
Jan 4, 2024 3:25 PM UTC

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.

Translate
AsifChowdhury
Community Advisor
AsifChowdhuryCommunity AdvisorAuthorAccepted solution
Community Advisor
Jan 12, 2024 10:07 AM UTC

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)); } } }
Translate