Search in sources :

Example 1 with DocumentTypeService

use of org.kuali.rice.kew.api.doctype.DocumentTypeService 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)

Aggregations

Timestamp (java.sql.Timestamp)1 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)1 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)1 DocumentType (org.kuali.rice.kew.api.doctype.DocumentType)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