filenet-content-enginefilenet-process-enginecontent-platform-engine

Filenet - Get Email Id out of user id in Filenet Workflow


I am new to Filenet BPM and I am working on an approval system workflow where an attached document is either approved Or rejected based on the response. I have to send an email to Originator that the document is approved Or rejected and I am able to fetch the userId/AliasId of a person who launched the workflow but I am unable to get the emailId out of a userid. We already had an LDAP configuration settings at domain level but I don't know what should I do to achieve this functionality. Please help.


Solution

  • You should use com.filenet.api.security.User:

    User user = Factory.User.fetchInstance(connection, userId, null);
    String email = user.get_Email();
    

    userId may be in different forms, as noted in the documentation:

    Valid strings are the Id, the short name, or the distinguished name. If the authentication provider is Microsoft Active Directory, you can also specify the UPN.