Search in sources :

Example 6 with DocumentType

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());
    }
}
Also used : PurapService(org.kuali.kfs.module.purap.document.service.PurapService) WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) DocumentType(org.kuali.rice.kew.api.doctype.DocumentType) DocumentAttributeIndexingQueue(org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue) PaymentRequestDocument(org.kuali.kfs.module.purap.document.PaymentRequestDocument) DocumentTypeService(org.kuali.rice.kew.api.doctype.DocumentTypeService) Timestamp(java.sql.Timestamp)

Example 7 with DocumentType

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));
}
Also used : DocumentType(org.kuali.rice.kew.api.doctype.DocumentType)

Aggregations

DocumentType (org.kuali.rice.kew.api.doctype.DocumentType)7 AutoCancelBatchStep (edu.cornell.kfs.sys.batch.AutoCancelBatchStep)1 Timestamp (java.sql.Timestamp)1 ArrayList (java.util.ArrayList)1 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)1 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)1 AutoDisapproveDocumentsStep (org.kuali.kfs.sys.batch.AutoDisapproveDocumentsStep)1 DocumentTypeService (org.kuali.rice.kew.api.doctype.DocumentTypeService)1 DocumentAttributeIndexingQueue (org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue)1 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)1