use of org.kuali.rice.kew.api.doctype.DocumentType in project cu-kfs by CU-CommunityApps.
the class CuPdpExtractServiceImpl method updatePaymentRequest.
@Override
protected void updatePaymentRequest(PaymentRequestDocument paymentRequestDocument, Person puser, Date processRunDate) {
try {
PaymentRequestDocument doc = (PaymentRequestDocument) documentService.getByDocumentHeaderId(paymentRequestDocument.getDocumentNumber());
doc.setExtractedTimestamp(new Timestamp(processRunDate.getTime()));
SpringContext.getBean(PurapService.class).saveDocumentNoValidation(doc);
// RICE20 replaced searchableAttributeProcessingService.indexDocument with DocumentAttributeIndexingQueue.indexDocument
DocumentTypeService documentTypeService = SpringContext.getBean(DocumentTypeService.class);
DocumentType documentType = documentTypeService.getDocumentTypeByName(doc.getFinancialDocumentTypeCode());
DocumentAttributeIndexingQueue queue = KewApiServiceLocator.getDocumentAttributeIndexingQueue(documentType.getApplicationId());
queue.indexDocument(doc.getDocumentNumber());
} catch (WorkflowException e) {
throw new IllegalArgumentException("Unable to retrieve payment request: " + paymentRequestDocument.getDocumentNumber());
}
}
use of org.kuali.rice.kew.api.doctype.DocumentType in project cu-kfs by CU-CommunityApps.
the class CuAutoDisapproveDocumentsServiceImplTest method testCheckIffParentDocumentTypeParameterExists.
public final void testCheckIffParentDocumentTypeParameterExists() {
boolean isExist = autoDisapproveDocumentsService.checkIfParentDocumentTypeParameterExists();
boolean parameterExists = false;
if (parameterService.parameterExists(AutoDisapproveDocumentsStep.class, KFSParameterKeyConstants.YearEndAutoDisapprovalConstants.YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE)) {
List<DocumentType> parentDocumentTypes = autoDisapproveDocumentsService.getYearEndAutoDisapproveParentDocumentTypes();
for (DocumentType parentDocumentType : parentDocumentTypes) {
if (ObjectUtils.isNotNull(documentTypeService.getDocumentTypeByName(parentDocumentType.getName()))) {
parameterExists = true;
break;
}
}
}
assertTrue("YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE System parameter does not exist.", (parameterExists && isExist) || (!parameterExists && !isExist));
}
Aggregations