Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Getting session of initiator of workflow to get mail id

Avatar

Level 3

Hi,

I have a workflow in which one group starts the workflow and in next step it get assigned to another group. I want email id of initiator and I am using the below code for the same. But it is returning me the email id of the current workflow assigned group. May be because I am using session and session is of current group. Is it possible to get the session of the initiator??

Session session = workflowSession.adaptTo(Session.class);

resourceResolver = getResourceResolver(session);

UserManager userManager = resourceResolver.adaptTo(UserManager.class);

if (userManager != null) {

  Authorizable authorizable = userManager.getAuthorizable(workItem.getWorkflow().getInitiator());

  Value[] values = authorizable.getProperty("./profile/email");

0 Replies