if(result == null){ throw new InvalidArgumentsServiceException();
final Person person = AccessControl.getUserView().getPerson(); ResultParticipation resultParticipation = null;  if(bean.getPerson()!=null) { resultParticipation = new ResultParticipation(result,bean.getPerson(),bean.getResultParticipationRole(), person); } else { if (!(bean.getOrganization()==null && (bean.getOrganizationName()==null||bean.getOrganizationName().equals("")))) { final InsertExternalPerson insertExternalPerson = new InsertExternalPerson(); final ExternalPerson externalPerson; if (bean.getOrganization() == null) { externalPerson = insertExternalPerson.run(bean.getPersonName(), bean.getOrganizationName()); } else { externalPerson = insertExternalPerson.run(bean.getPersonName(), bean.getOrganization()); } resultParticipation = new ResultParticipation(result,externalPerson.getPerson(),bean.getResultParticipationRole(), person); }
    public ResultParticipation run(ResultParticipationSimpleCreationBean bean, Integer resultId, String personName) throws ExcepcaoPersistencia, FenixServiceException {        final Result result = rootDomainObject.readResultByOID(resultId);                if(result == null){            throw new InvalidArgumentsServiceException();        }                return new ResultParticipation(result,bean.getPerson(),result.getResultParticipationsCount(),bean.getResultParticipationRole(), personName);    }