Search in sources :

Example 6 with KualiRuleService

use of org.kuali.kfs.krad.service.KualiRuleService in project cu-kfs by CU-CommunityApps.

the class IWantDocumentAction method continueToItems.

/**
 * Takes the user to next page
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return
 * @throws Exception
 */
public ActionForward continueToItems(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    IWantDocumentForm iWantForm = (IWantDocumentForm) form;
    IWantDocument iWantDocument = iWantForm.getIWantDocument();
    iWantDocument.setExplanation(iWantDocument.getDocumentHeader().getExplanation());
    KualiRuleService ruleService = SpringContext.getBean(KualiRuleService.class);
    boolean rulePassed = true;
    // call business rules
    rulePassed &= ruleService.applyRules(new RouteDocumentEvent(KFSConstants.DOCUMENT_HEADER_ERRORS, iWantDocument));
    if (rulePassed) {
        iWantForm.setStep(CUPurapConstants.IWantDocumentSteps.ITEMS_AND_ACCT_DATA_STEP);
        iWantDocument.setStep(CUPurapConstants.IWantDocumentSteps.ITEMS_AND_ACCT_DATA_STEP);
    }
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : KualiRuleService(org.kuali.kfs.krad.service.KualiRuleService) RouteDocumentEvent(org.kuali.kfs.krad.rules.rule.event.RouteDocumentEvent) IWantDocument(edu.cornell.kfs.module.purap.document.IWantDocument) PurApFavoriteAccountLineBuilderForIWantDocument(edu.cornell.kfs.module.purap.util.PurApFavoriteAccountLineBuilderForIWantDocument)

Aggregations

KualiRuleService (org.kuali.kfs.krad.service.KualiRuleService)6 IWantDocument (edu.cornell.kfs.module.purap.document.IWantDocument)3 PurApFavoriteAccountLineBuilderForIWantDocument (edu.cornell.kfs.module.purap.util.PurApFavoriteAccountLineBuilderForIWantDocument)3 RouteDocumentEvent (org.kuali.kfs.krad.rules.rule.event.RouteDocumentEvent)3 IWantAccount (edu.cornell.kfs.module.purap.businessobject.IWantAccount)1 IWantItem (edu.cornell.kfs.module.purap.businessobject.IWantItem)1 AddIWantItemEvent (edu.cornell.kfs.module.purap.document.validation.event.AddIWantItemEvent)1 KualiAddLineEvent (org.kuali.kfs.kns.rule.event.KualiAddLineEvent)1 PurApAccountingLine (org.kuali.kfs.module.purap.businessobject.PurApAccountingLine)1 PurApItem (org.kuali.kfs.module.purap.businessobject.PurApItem)1 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)1 PurchasingAccountsPayableDocumentBase (org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocumentBase)1 VendorCreditMemoDocument (org.kuali.kfs.module.purap.document.VendorCreditMemoDocument)1 PurchasingAccountsPayableItemPreCalculateEvent (org.kuali.kfs.module.purap.document.validation.event.PurchasingAccountsPayableItemPreCalculateEvent)1 WorkflowDocument (org.kuali.rice.kew.api.WorkflowDocument)1