use of edu.cornell.kfs.module.purap.document.IWantDocument in project cu-kfs by CU-CommunityApps.
the class IWantDocumentAction method addItem.
/**
* Adds an item to the document
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward addItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
IWantDocumentForm iWantDocumentForm = (IWantDocumentForm) form;
IWantDocument iWantDocument = (IWantDocument) iWantDocumentForm.getDocument();
IWantItem item = iWantDocumentForm.getNewIWantItemLine();
addNewItem(iWantDocumentForm, iWantDocument, item);
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of edu.cornell.kfs.module.purap.document.IWantDocument in project cu-kfs by CU-CommunityApps.
the class IWantDocumentRule method processCustomRouteDocumentBusinessRules.
@Override
protected boolean processCustomRouteDocumentBusinessRules(Document document) {
boolean valid = super.processCustomRouteDocumentBusinessRules(document);
IWantDocument iWantDocument = (IWantDocument) document;
if (SpringContext.getBean(FinancialSystemWorkflowHelperService.class).isAdhocApprovalRequestedForPrincipal(document.getDocumentHeader().getWorkflowDocument(), GlobalVariables.getUserSession().getPrincipalId())) {
// validate that Complete order option was selected
if (StringUtils.isBlank(iWantDocument.getCompleteOption())) {
GlobalVariables.getMessageMap().putError("document.completeOption", CUPurapKeyConstants.ERROR_IWNT_CONMPLETE_ORDER_OPTION_REQUIRED);
}
}
return valid;
}
Aggregations