Object[] args = { degreeCurricularPlanID, new Integer(1)}; InfoExecutionDegree infoExecutionDegree = null;  infoExecutionDegree = (InfoExecutionDegree) ServiceManagerServiceFactory.executeService(userView, "ReadExecutionDegreeByDegreeCurricularPlanID", args);  String idInternal = infoExecutionDegree.getIdInternal().toString();
String idInternal = (String) finalWorkForm.get("idInternal");
    public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request,            HttpServletResponse response) throws FenixActionException, FenixFilterException, FenixServiceException {        DynaActionForm finalWorkForm = (DynaActionForm) form;        IUserView userView = SessionUtils.getUserView(request);                Integer degreeCurricularPlanID = (Integer) finalWorkForm.get("degreeCurricularPlanID");        request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID);                        Object[] args = { degreeCurricularPlanID, new Integer(1)};        InfoExecutionDegree infoExecutionDegree = null;            infoExecutionDegree = (InfoExecutionDegree) ServiceManagerServiceFactory.executeService(userView,                    "ReadExecutionDegreeByDegreeCurricularPlanID", args);                String idInternal = infoExecutionDegree.getIdInternal().toString();        String title = (String) finalWorkForm.get("title");        String responsibleCreditsPercentage = (String) finalWorkForm.get("responsibleCreditsPercentage");        String coResponsibleCreditsPercentage = (String) finalWorkForm                .get("coResponsibleCreditsPercentage");        String companionName = (String) finalWorkForm.get("companionName");        String companionMail = (String) finalWorkForm.get("companionMail");        String companionPhone = (String) finalWorkForm.get("companionPhone");        String framing = (String) finalWorkForm.get("framing");        String objectives = (String) finalWorkForm.get("objectives");        String description = (String) finalWorkForm.get("description");        String requirements = (String) finalWorkForm.get("requirements");        String deliverable = (String) finalWorkForm.get("deliverable");        String url = (String) finalWorkForm.get("url");        String minimumNumberOfGroupElements = (String) finalWorkForm.get("minimumNumberOfGroupElements");        String maximumNumberOfGroupElements = (String) finalWorkForm.get("maximumNumberOfGroupElements");        String degreeType = (String) finalWorkForm.get("degreeType");        String observations = (String) finalWorkForm.get("observations");        String location = (String) finalWorkForm.get("location");        String companyAdress = (String) finalWorkForm.get("companyAdress");        String companyName = (String) finalWorkForm.get("companyName");        String orientatorOID = (String) finalWorkForm.get("orientatorOID");        String coorientatorOID = (String) finalWorkForm.get("coorientatorOID");        String degree = (String) finalWorkForm.get("degree");        String[] branchList = (String[]) finalWorkForm.get("branchList");        String status = (String) finalWorkForm.get("status");        Integer min = new Integer(minimumNumberOfGroupElements);        Integer max = new Integer(maximumNumberOfGroupElements);        if ((min.intValue() > max.intValue()) || (min.intValue() <= 0)) {            ActionErrors actionErrors = new ActionErrors();            actionErrors.add("finalWorkInformationForm.numberGroupElements.invalidInterval",                    new ActionError("finalWorkInformationForm.numberGroupElements.invalidInterval"));            saveErrors(request, actionErrors);            return mapping.getInputForward();        }        Integer orientatorCreditsPercentage = new Integer(responsibleCreditsPercentage);        Integer coorientatorCreditsPercentage = new Integer(coResponsibleCreditsPercentage);        if ((orientatorCreditsPercentage.intValue() < 0)                || (coorientatorCreditsPercentage.intValue() < 0)                || (orientatorCreditsPercentage.intValue() + coorientatorCreditsPercentage.intValue() != 100)) {            ActionErrors actionErrors = new ActionErrors();            actionErrors.add("finalWorkInformationForm.invalidCreditsPercentageDistribuition",                    new ActionError("finalWorkInformationForm.invalidCreditsPercentageDistribuition"));            saveErrors(request, actionErrors);            return mapping.getInputForward();        }        InfoProposal infoFinalWorkProposal = new InfoProposal();        if (idInternal != null && !idInternal.equals("") && StringUtils.isNumeric(idInternal)) {            infoFinalWorkProposal.setIdInternal(new Integer(idInternal));        }        infoFinalWorkProposal.setTitle(title);        infoFinalWorkProposal.setOrientatorsCreditsPercentage(new Integer(responsibleCreditsPercentage));        infoFinalWorkProposal.setCoorientatorsCreditsPercentage(new Integer(                coResponsibleCreditsPercentage));        infoFinalWorkProposal.setFraming(framing);        infoFinalWorkProposal.setObjectives(objectives);        infoFinalWorkProposal.setDescription(description);        infoFinalWorkProposal.setRequirements(requirements);        infoFinalWorkProposal.setDeliverable(deliverable);        infoFinalWorkProposal.setUrl(url);        infoFinalWorkProposal.setMinimumNumberOfGroupElements(new Integer(minimumNumberOfGroupElements));        infoFinalWorkProposal.setMaximumNumberOfGroupElements(new Integer(maximumNumberOfGroupElements));        infoFinalWorkProposal.setObservations(observations);        infoFinalWorkProposal.setLocation(location);        TipoCurso tipoCurso = new TipoCurso(new Integer(degreeType));        infoFinalWorkProposal.setDegreeType(tipoCurso);        infoFinalWorkProposal.setOrientator(new InfoTeacher());        infoFinalWorkProposal.getOrientator().setIdInternal(new Integer(orientatorOID));        if (coorientatorOID != null && !coorientatorOID.equals("")) {            infoFinalWorkProposal.setCoorientator(new InfoTeacher());            infoFinalWorkProposal.getCoorientator().setIdInternal(new Integer(coorientatorOID));        } else {            if (coorientatorCreditsPercentage.intValue() != 0) {                ActionErrors actionErrors = new ActionErrors();                actionErrors                        .add(                                "finalWorkInformationForm.invalidCreditsPercentageDistribuition",                                new ActionError(                                        "finalWorkInformationForm.invalidCreditsPercentageDistribuition"));                saveErrors(request, actionErrors);                return mapping.getInputForward();            }            infoFinalWorkProposal.setCompanionName(companionName);            infoFinalWorkProposal.setCompanionMail(companionMail);            if (companionPhone != null && !companionPhone.equals("")                    && StringUtils.isNumeric(companionPhone)) {                infoFinalWorkProposal.setCompanionPhone(new Integer(companionPhone));            }            infoFinalWorkProposal.setCompanyAdress(companyAdress);            infoFinalWorkProposal.setCompanyName(companyName);        }        infoFinalWorkProposal.setExecutionDegree(new InfoExecutionDegree());        infoFinalWorkProposal.getExecutionDegree().setIdInternal(new Integer(degree));        if (branchList != null && branchList.length > 0) {            infoFinalWorkProposal.setBranches(new ArrayList());            for (int i = 0; i < branchList.length; i++) {                String brachOIDString = branchList[i];                if (brachOIDString != null && StringUtils.isNumeric(brachOIDString)) {                    InfoBranch infoBranch = new InfoBranch();                    infoBranch.setIdInternal(new Integer(brachOIDString));                    infoFinalWorkProposal.getBranches().add(infoBranch);                }            }        }        if (status != null && !status.equals("") && StringUtils.isNumeric(status)) {            infoFinalWorkProposal.setStatus(new FinalDegreeWorkProposalStatus(new Integer(status)));        }        try {            Object argsProposal[] = { infoFinalWorkProposal };            ServiceUtils.executeService(userView, "SubmitFinalWorkProposal", argsProposal);        } catch (Exception e) {            if(e instanceof OutOfPeriodException){                ActionErrors actionErrors = new ActionErrors();                actionErrors.add("finalWorkInformationForm.scheduling.invalidInterval",                        new ActionError("finalWorkInformationForm.scheduling.invalidInterval"));                saveErrors(request, actionErrors);                return mapping.getInputForward();            }            throw new FenixActionException(e);        }        return mapping.findForward("show-final-degree-work-list");    }