Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Get Worflow Initiator email Id

Avatar

Level 4

Hi there,

I have create workflow in which approver can reject the request. When approver reject the request, the mail as to trigger to initiator.

Using below code I can achieve it - Working

 manager = userManagerFactory.createUserManager(session);
        if (manager.hasAuthorizable(groupname)) {
            Authorizable id = manager.get(groupname);
            log.info("***** name ******" + id.getName());
            if (id.isUser()) {
                user = (User) id;
                userProfile = user.getProfile();
                if (userProfile.getPrimaryMail() != null&& userProfile.getPrimaryMail().length() != 0) {
                    initiatorMail = userProfile.getPrimaryMail();
                    log.info("*** User primary mail id : ***"+ initiatorMail);
                }
            }

But UserManage, Authorizable ,Profile classes are shown as deprecated. 

I am using AEM6.0. Can any one suggest me how to achieve this in AEM6.0 without deprecated class.

In other way what is the alternate class to get the user email in workflow. 

Thanks

Nanda

1 Accepted Solution

Avatar

Correct answer by
Level 10

Use the org.apache.jackrabbit.api.security.user Java package. This is the UserManager API to use. 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Use the org.apache.jackrabbit.api.security.user Java package. This is the UserManager API to use.