When i try my java code i get the following error
Failed to load resource: the server responded with a status of 500 (Erreur Interne de Servlet)
My java Code :
public class myAuthTest implements JavaDelegate {
@Autowired
protected UserService userService ;
@Override
public void execute(DelegateExecution execution) throws Exception {
//Set<User> users = group.getUsers();
String wfUserName = Authentication.getAuthenticatedUserId();
long myLongLongLong = Long.parseLong(wfUserName);
User x = userService.getUser(myLongLongLong) ;
if (x!=null){
String myName = x.getFirstName() ;
execution.setVariable("myInitiator", myName);
}
else {
execution.setVariable("myInitiator", "echec");
}
//int initiatorId = (int) execution.getVariable("initiator");
//String str = UserInfoBean.getUser(initiatorId);
execution.setVariable("myUserName","JeChangeAutomatiquement") ;
//long userId = new Long((Long)execution.getVariable("assignToDrafterdrafter")).longValue();
//String externalUserName = userService.findActiveUser(myLongLongLong).getExternalId();
//execution.setVariable("myInitiator",wfUserName) ;
}
}
I try to transform my Authentication.getAuthenticatedUserId() into the username but i dont know how to do this
Can you help me please ,