protected Logger loger = Logger.getLogger(ProcessToolJbpmSession.class.getName());
public ProcessToolJbpmSession(UserData user, Collection<String> roleNames, ProcessToolContext ctx) {
super(user, roleNames, ctx.getRegistry());
if (user != null) {
IdentityService is = getProcessEngine(ctx).getIdentityService();
User jbpmUser = is.findUserById(user.getLogin());
if (jbpmUser == null) {
is.createUser(user.getLogin(), user.getRealName(), user.getEmail());
}
getProcessEngine(ctx).setAuthenticatedUserId(user.getLogin());
}
}