AEM 6.2 Classic : Capture comments in default email template used by workflow | Community
Skip to main content
cquser1
Level 7
August 31, 2018
Solved

AEM 6.2 Classic : Capture comments in default email template used by workflow

  • August 31, 2018
  • 18 replies
  • 4445 views

Hi All,

The use case for us is same as mentioned in Capturing comments in default email template used by workflow in 6.2 .

Tried the solution mentioned in the above forum post, but no luck.

All the participant steps in our case is "Dynamic Participant Step". Tried multiple things in "/etc/workflow/notification/email/default/en.txt/", based on Configuring Email Notification  but no luck.

Any thoughts/pointers/reference code on this will be really helpful.

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 arunpatidar

Hi,

Did you try below,  mentioned at Configuring Email Notification

Comment: ${item.data.comment}\n \

18 replies

smacdonald2008
Level 10
August 31, 2018

Ratna Kumar​ can you comment here too please.

cquser1
cquser1Author
Level 7
August 31, 2018

Hi Scott,

Since via OOTB template we are not able to extract comments provided in the previous step, we are trying to implement something very similar[ALONG WITH COMMENTS] via custom step.

However, the challenge we are facing is not being able to get the user details of the next step to which the mail[which will have comments/time etc of the previous participant step] should go to.

Also, in all our participant steps, across the workflow [we are using dynamic participant step]. Here, we are giving the group name in "Arguments" section and we have an ecma script, as provided [

function getParticipant() {

    return args[0];

}

] in "Participant Chooser", based on which it is assigned to the corresponding group.

arunpatidar
Community Advisor
Community Advisor
September 1, 2018

Guys,

${item.data.comment} does works for node transitions emails when user get notification to act on step but not when email triggered for Completion/Abort jobs.

Arun Patidar
cquser1
cquser1Author
Level 7
September 2, 2018

Hi Arun,

We are using "Dynamic Participant Step" for all the participant activities. Is it something like because of this, we are not able to use item.data.comment

cquser1
cquser1Author
Level 7
September 2, 2018

Hi Arun,

Considering the overall factors, looks like as you mentioned, we have to go ahead with "Participant step" instead of "Dynamic Participant step".

Tried doing it via custom process step, but realized that the issue will occur if we do a "stepback" from any of the step. That will again create issues.

One thing we noticed is just after Flow Start, if we have "Participant Step" and while initiating wf from page, if we provide comments, then that that doesn't get populated via ${item.data.comment}. It is stored under "startComment" property under /etc/workflow/instances/server0/2018-09-02/instance_1/data/metaData. But we need ${item.data.comment} in that step, as it will be used if we do a "stepback" at any point of time in the workflow.

So, basically - the very first time workflow is triggered(i.e, in the above mentioned scenario), we will have an issue. At rest of the times, it will work fine, along with the "aborting/completion" limitation you mentioned.

In case, you have some pointers/solution for the "very first time workflow is triggered" thing, please do let us know.

cquser1
cquser1Author
Level 7
September 2, 2018

Update

For the "very first time workflow is triggered", added a custom process step to get the comment values. Testing it out.

cquser1
cquser1Author
Level 7
September 2, 2018

Hi Arun/All,

With custom process step, able to somehow get that to work. Facing another challenge, for which I have raised another query.

AEM 6.2 classic : How to use OOTB Email Templates for Workflow Notification for different workflows

Any thoughts/pointers/reference will be really helpful.

arunpatidar
Community Advisor
Community Advisor
September 2, 2018
Arun Patidar