public void run(String username, String costCenter, String userNumber) throws FenixServiceException, ExcepcaoPersistencia { Person person = Person.readPersonByUsername(username);
public void run(Person person, String costCenter, String userNumber) throws FenixServiceException, ExcepcaoPersistencia {
    public void run(String username, String costCenter, String userNumber) throws FenixServiceException, ExcepcaoPersistencia {        Person person = Person.readPersonByUsername(username);        Role role = Role.getRoleByRoleType(RoleType.PROJECTS_MANAGER);        if (ProjectAccess.getAllByPersonAndCostCenter(person, false, true).size() == 0) {            Teacher teacher = person.getTeacher();            if (teacher == null) {                Employee employee = person.getEmployee();                if (employee != null) {                    IPersistentSuportOracle persistentSupportOracle = PersistentSuportOracle.getInstance();                    if ((persistentSupportOracle.getIPersistentProject().countUserProject(employee.getEmployeeNumber()) == 0)) {                        List<ProjectAccess> accessesToDelete = ProjectAccess.getAllByPersonAndCostCenter(person, false, false);                        for (ProjectAccess access : accessesToDelete) {                            access.delete();                        }                                                person.removePersonRoles(role);                    }                } else                    throw new FenixServiceException();            }        }        role = Role.getRoleByRoleType(RoleType.INSTITUCIONAL_PROJECTS_MANAGER);        if (ProjectAccess.getAllByPersonAndCostCenter(person, true, true).size() == 0) {            Teacher teacher = person.getTeacher();            if (teacher == null) {                Employee employee = person.getEmployee();                if (employee != null) {                    IPersistentSuportOracle persistentSupportOracle = PersistentSuportOracle.getInstance();                    if ((persistentSupportOracle.getIPersistentProject().countUserProject(employee.getEmployeeNumber()) == 0)) {                        List<ProjectAccess> accessesToDelete = ProjectAccess.getAllByPersonAndCostCenter(person, true, false);                        for (ProjectAccess access : accessesToDelete) {                            access.delete();                        }                                                person.removePersonRoles(role);                    }                } else                    throw new FenixServiceException();            }        }    }