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);
}
Aggregations