Search in sources :

Example 36 with WorkflowDocument

use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.

the class CuPurchasingProcessVendorValidation method isDocumentInNodeWhereMopotDataValidationIsBypassed.

/**
 * KFSPTS-1458
 * Using Route nodes to determine when data validation should occur based on functional user's requirements.
 */
private boolean isDocumentInNodeWhereMopotDataValidationIsBypassed(PurchasingDocument purDocument) {
    boolean return_value = false;
    WorkflowDocument workflowDoc = purDocument.getDocumentHeader().getWorkflowDocument();
    // List<String>  currentRouteLevels = Arrays.asList(Strings.split(purDocument.getDocumentHeader().getWorkflowDocument().getCurrentNodeNames(), ","));
    Set<String> currentRouteLevels = workflowDoc.getCurrentNodeNames();
    if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.ACCOUNT_NODE) && workflowDoc.isApprovalRequested() && !workflowDoc.getDocumentTypeName().equals(PurapConstants.PurchaseOrderDocTypes.PURCHASE_ORDER_AMENDMENT_DOCUMENT)) {
        // added document not being a POA to conditional check due to FO being able to change data during account node approval on the POA and needed validation being bypassed
        return_value = true;
    } else if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.SEPARATION_OF_DUTIES_NODE) && workflowDoc.isApprovalRequested()) {
        return_value = true;
    } else if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.AWARD_NODE) && workflowDoc.isApprovalRequested()) {
        return_value = true;
    } else if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.SUB_ACCOUNT_NODE) && workflowDoc.isApprovalRequested()) {
        return_value = true;
    } else if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.COMMODITY_NODE) && workflowDoc.isApprovalRequested()) {
        return_value = true;
    } else if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.COMMODITY_APO_NODE) && workflowDoc.isApprovalRequested()) {
        return_value = true;
    } else if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.ACCOUNTING_ORGANIZATION_HIERARCHY_NODE) && workflowDoc.isApprovalRequested()) {
        return_value = true;
    } else if (currentRouteLevels.contains(CUPurapConstants.MethodOfPOTransmissionByPassValidationNodes.AD_HOC_NODE) && financialSystemWorkflowHelperService.isAdhocApprovalRequestedForPrincipal(workflowDoc, GlobalVariables.getUserSession().getPrincipalId())) {
        // Doc could be editable OR NON-editable for a user when it is stopped on an AdHoc Route Node
        // bypass validation check when document is in adhoc route node and adhoc was requested
        return_value = true;
    }
    return (return_value);
}
Also used : WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument)

Aggregations

WorkflowDocument (org.kuali.rice.kew.api.WorkflowDocument)36 ArrayList (java.util.ArrayList)4 FinancialSystemDocumentHeader (org.kuali.kfs.sys.businessobject.FinancialSystemDocumentHeader)4 Person (org.kuali.rice.kim.api.identity.Person)4 IWantDocument (edu.cornell.kfs.module.purap.document.IWantDocument)3 ActionForward (org.apache.struts.action.ActionForward)3 KualiDocumentFormBase (org.kuali.kfs.kns.web.struts.form.KualiDocumentFormBase)3 RequisitionDocument (org.kuali.kfs.module.purap.document.RequisitionDocument)3 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)2 PurApFavoriteAccountLineBuilderForIWantDocument (edu.cornell.kfs.module.purap.util.PurApFavoriteAccountLineBuilderForIWantDocument)2 Iterator (java.util.Iterator)2 List (java.util.List)2 MaintenanceDocument (org.kuali.kfs.kns.document.MaintenanceDocument)2 PurApAccountingLine (org.kuali.kfs.module.purap.businessobject.PurApAccountingLine)2 PurApItem (org.kuali.kfs.module.purap.businessobject.PurApItem)2 PurchaseOrderItem (org.kuali.kfs.module.purap.businessobject.PurchaseOrderItem)2 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)2 PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)2 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)2 FinancialSystemWorkflowHelperService (org.kuali.kfs.sys.service.FinancialSystemWorkflowHelperService)2