Expand my Community achievements bar.

SOLVED

Workflow : Get current host , inbox link & comment

Avatar

Level 4

Hello Community, 

 

I have been working on a workflow process step in which we will send an email to each and every user of a certain group (passed as an argument to the workflow) upon starting the workflow so that the approvers can see everything that they need without much hassle. This workflow will be used to publish pages/assets ( there is a participant step for approving/denying as well). The email will consist of the initiator, timestamp, and comments(passed while starting the workflow), payload, etc.  Almost 60-70% of the work is done. 

 

I am having a hard time getting the comment and the payload(as a clickable link). How can I get the following inside my code?

 

1) comment that was passed during the workflow initiation?

3) A link to the inbox so that the user can go to his/her current inbox and browse the content

2) A clickable link that will take the approver to the payload for that particular instance on which the workflow was initiated.

Initially, I thought of getting the hostname of the instance from which the workflow was initiated and then concatenating the payload with the host and using it as the link. But could not find a way to retrieve the current host inside the process step. 

Another Idea is to bind the author's URL (e.g. https://author-p11111-e11111.adobeaemcloud.com) based on which environment it is on (stage/prod/dev). Eventually, the link would become "https://author-p11111-e11111.adobeaemcloud.com + content/project/us/en/payload + .html".  But this is a very static approach, and I am wondering if there is any better option. 

 

Anybody who has a solution please drop it. If I explained the question very vaguely, please do ask me for any information you need.

 

Thanks,

Ankan

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Level 2

to get comment u have use below method 


List<HistoryItem> workflowHistory = workflowSession.getHistory(workItem.getWorkflow());

for (HistoryItem itemhistory : workflowHistory) {
reviewerComment = itemhistory.getComment();
}