Hi Andre,
Actually, I had no time to test what I wrote earlier ... the code below should work in a library source:
// Example code to illustrate
package masalan;
import com.redwood.scheduler.api.model.SchedulerSession;
import com.redwood.scheduler.api.model.enumeration.SubjectType;
import com.redwood.scheduler.api.scripting.variables.*;
public class user
{
public static String getEmail(String str1)
{
if (str1 == null ) return "null";
SchedulerSession jcsSession = ScriptSessionFactory.getSession();
return jcsSession.getSubjectByTypeName(SubjectType.User, str1).getEmail();
}
}
You create REL entry points:
- Name - getEmail
- FQ Class Name - masalan.user
- Method Signature - getEmail(String)
Now, create a parameter Username on the job chain.
Parameter To should have the value =Custom.getEmail(chainParameters.Username)
You specify the username in the Username parameter, the email address will be retrieved from CPS. The user must have logged on to CPS at least once, alternatively, you can import the user.
Note that to import the user, you must assign at the very least the AccessScheduler action in UME.
Regards,
HP
Message was edited by: h. Carpenter - missed an import and add SchedulerSession