Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

AEM Inbox

Avatar

Community Advisor

How to capture workflow comment in AEM inbox. I can add custom column in AEM inbox but how to capture the exact column and value in the AEM inbox.

 

AsifChowdhury_0-1704369035742.png

AsifChowdhury_1-1704369142476.png

 

By default the comments is under each work item

 

AsifChowdhury_0-1704369291786.png

 

But I need to show it in the inbox

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

3 Replies

Avatar

Community Advisor

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.

Avatar

Correct answer by
Community Advisor

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