Search in sources :

Example 1 with IWantView

use of edu.cornell.kfs.module.purap.businessobject.IWantView in project cu-kfs by CU-CommunityApps.

the class CuPurapServiceImpl method saveRoutingDataForRelatedDocuments.

// ==== CU Customization (KFSPTS-1656): Save IWantDocument routing data. ====
@Override
public void saveRoutingDataForRelatedDocuments(Integer accountsPayablePurchasingDocumentLinkIdentifier) {
    super.saveRoutingDataForRelatedDocuments(accountsPayablePurchasingDocumentLinkIdentifier);
    try {
        // Save IWNT routing data.
        @SuppressWarnings("unchecked") List<IWantView> iWantViews = getRelatedViews(IWantView.class, accountsPayablePurchasingDocumentLinkIdentifier);
        for (Iterator<IWantView> iterator = iWantViews.iterator(); iterator.hasNext(); ) {
            IWantView view = (IWantView) iterator.next();
            Document doc = documentService.getByDocumentHeaderId(view.getDocumentNumber());
            doc.getDocumentHeader().getWorkflowDocument().saveDocumentData();
        }
    } catch (WorkflowException e) {
        throw new InfrastructureException("unable to save routing data for related docs", e);
    }
}
Also used : WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) IWantView(edu.cornell.kfs.module.purap.businessobject.IWantView) VendorCreditMemoDocument(org.kuali.kfs.module.purap.document.VendorCreditMemoDocument) Document(org.kuali.kfs.krad.document.Document) PurchasingAccountsPayableDocument(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument) InfrastructureException(org.kuali.kfs.krad.exception.InfrastructureException)

Example 2 with IWantView

use of edu.cornell.kfs.module.purap.businessobject.IWantView in project cu-kfs by CU-CommunityApps.

the class CuPurapServiceImpl method getRelatedDocumentIds.

// ==== CU Customization (KFSPTS-1656): Get IWantDocument views. ====
@Override
public List<String> getRelatedDocumentIds(Integer accountsPayablePurchasingDocumentLinkIdentifier) {
    List<String> documentIdList = super.getRelatedDocumentIds(accountsPayablePurchasingDocumentLinkIdentifier);
    // Get IWNT views.
    @SuppressWarnings("unchecked") List<IWantView> iWantViews = getRelatedViews(IWantView.class, accountsPayablePurchasingDocumentLinkIdentifier);
    for (Iterator<IWantView> iterator = iWantViews.iterator(); iterator.hasNext(); ) {
        IWantView view = (IWantView) iterator.next();
        documentIdList.add(view.getDocumentNumber());
    }
    return documentIdList;
}
Also used : IWantView(edu.cornell.kfs.module.purap.businessobject.IWantView)

Aggregations

IWantView (edu.cornell.kfs.module.purap.businessobject.IWantView)2 Document (org.kuali.kfs.krad.document.Document)1 InfrastructureException (org.kuali.kfs.krad.exception.InfrastructureException)1 PurchasingAccountsPayableDocument (org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)1 VendorCreditMemoDocument (org.kuali.kfs.module.purap.document.VendorCreditMemoDocument)1 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)1