当前位置: 首页>>代码示例>>Java>>正文


Java WorkflowDocumentService类代码示例

本文整理汇总了Java中org.kuali.rice.krad.workflow.service.WorkflowDocumentService的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocumentService类的具体用法?Java WorkflowDocumentService怎么用?Java WorkflowDocumentService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WorkflowDocumentService类属于org.kuali.rice.krad.workflow.service包,在下文中一共展示了WorkflowDocumentService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectorLookup

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * This method returns true if the selector is in the document's route log.
 *
 * @param item     Document containing this item will be validated for the selector.
 * @param selector Principal Id to be checked against the requisition document.
 * @return If the requisition item is valid to be returned with the search result.
 */
public boolean selectorLookup(OleRequisitionItem item, String selector) {
    LOG.debug("Inside selectorLookup of OleRequisitionItemLookupableHelperServiceImpl");
    boolean isValid = false;
    WorkflowDocumentService workflowDocumentService = KRADServiceLocatorWeb.getWorkflowDocumentService();
    Person principalPerson = SpringContext.getBean(PersonService.class).getPerson(GlobalVariables.getUserSession().getPerson().getPrincipalId());
    WorkflowDocument workflowDocument;
    try {
        workflowDocument = workflowDocumentService.createWorkflowDocument(item.getRequisition().getDocumentHeader().getWorkflowDocument().getDocumentTypeName(), principalPerson);
        // Modified for OLE - 2541 starts
        Principal principal = KEWServiceLocator.getIdentityHelperService().getPrincipal(selector);
        List actionRequests = KEWServiceLocator.getActionRequestService().findAllActionRequestsByDocumentId(
                item.getRequisition().getDocumentNumber());
        if (actionRequestListHasPrincipal(principal, actionRequests)) {
            isValid = true;
        }
        // Modified for OLE - 2541 ends
        // isValid = SpringContext.getBean(WorkflowDocumentService.class).isUserAuthenticatedByRouteLog(workflowDocument.getRouteHeaderId(), selector, true);
    } catch (WorkflowException wfe) {
        LOG.error("Workflow exception in selectorLookup :" + wfe.getMessage());
    }
    LOG.debug("Leaving selectorLookup of OleRequisitionItemLookupableHelperServiceImpl");
    return isValid;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:31,代码来源:OleOrderQueueDocument.java

示例2: populateWorkflowStatusDate

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * This method populates workflow status change date for a requisition item.
 *
 * @param item Requisition Item to populate workflow status date.
 * @return
 */
public void populateWorkflowStatusDate(OleRequisitionItem item) {
    LOG.debug("Inside populateWorkflowStatusDate of OleRequisitionItemLookupableHelperServiceImpl");
    Long documentNumber = Long.valueOf(item.getRequisition().getDocumentNumber());
    WorkflowDocumentService workflowDocumentService = SpringContext.getBean(WorkflowDocumentService.class);
    Person principalPerson = SpringContext.getBean(PersonService.class).getPerson(GlobalVariables.getUserSession().getPerson().getPrincipalId());
    WorkflowDocument workflowDocument;
    try {
        workflowDocument = workflowDocumentService.loadWorkflowDocument(item.getRequisition().getDocumentNumber(), principalPerson);
        item.setDateModified(convertTimestampToString(new Timestamp(workflowDocument
                .getApplicationDocumentStatusDate().getMillis())));
    } catch (WorkflowException ex) {
        GlobalVariables.getMessageMap().putError(OLEConstants.OrderQueue.REQUISITIONS, RiceKeyConstants.ERROR_CUSTOM, ex.getMessage());
    }
    LOG.debug("Leaving populateWorkflowStatusDate of OleRequisitionItemLookupableHelperServiceImpl");
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:22,代码来源:OleOrderQueueDocument.java

示例3: getActiveActionRequestsForCriteria

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * Retrieves the active action requests for the given criteria
 *
 * @param documentNumber
 * @param nodeName
 * @param user
 * @return List of action requests
 * @throws WorkflowException
 */
protected List<ActionRequest> getActiveActionRequestsForCriteria(String documentNumber, String nodeName, Person user) throws WorkflowException {
    if (StringUtils.isBlank(documentNumber)) {
        // throw exception
    }
    org.kuali.rice.kew.api.document.WorkflowDocumentService workflowDocService = KewApiServiceLocator.getWorkflowDocumentService();
    List<ActionRequest> actionRequests = workflowDocService.getActionRequestsForPrincipalAtNode(documentNumber, nodeName, user.getPrincipalId());
    List<ActionRequest> activeRequests = new ArrayList<ActionRequest>();
    for (ActionRequest actionRequest : actionRequests) {
        // identify which requests for the given node name can be satisfied by an action by this user
        if (actionRequest.isActivated()) {
            activeRequests.add(actionRequest);
        }
    }
    return activeRequests;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:25,代码来源:PurApWorkflowIntegrationServiceImpl.java

示例4: getWorkflowDocument

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * method to retrieve the workflow document for the given documentHeader.
 *
 * @return workflowDocument
 */
@Override
public WorkflowDocument getWorkflowDocument() {

    WorkflowDocument workflowDocument = null;

    if (hasWorkflowDocument()) {
        workflowDocument = super.getWorkflowDocument();
    }

    try {
        if (workflowDocument != null) {
            return workflowDocument;
        }
        if ( StringUtils.isNotBlank(getDocumentNumber()) ) {
            workflowDocument = SpringContext.getBean(WorkflowDocumentService.class).loadWorkflowDocument(getDocumentNumber(), GlobalVariables.getUserSession().getPerson());
        } else {
            throw new RuntimeException("Document number is blank/null.  Unable to load a WorkflowDocument" );
        }
    }
    catch (WorkflowException we) {
        throw new RuntimeException("Unable to load a WorkflowDocument object for " + getDocumentNumber(), we);
    }

    return workflowDocument;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:31,代码来源:FinancialSystemDocumentHeader.java

示例5: valueChanged

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
public boolean valueChanged() throws WorkflowException {
    WorkflowDocument document = SpringContext.getBean(WorkflowDocumentService.class).loadWorkflowDocument(docHeaderId, user);
    if ( ActionRequestType.COMPLETE.equals(actionRequested)) {
        return document.isCompletionRequested();
    }
    else if (ActionRequestType.APPROVE.equals(actionRequested)) {
        return document.isApprovalRequested();
    }
    else if (ActionRequestType.ACKNOWLEDGE.equals(actionRequested)) {
        return document.isAcknowledgeRequested();
    }
    else if (ActionRequestType.FYI.equals(actionRequested)) {
        return document.isFYIRequested();
    }
    return false;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:17,代码来源:DocumentWorkflowRequestMonitor.java

示例6: setUp

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
@Override
public void setUp() {
    customerDocumentServiceImpl = new CustomerDocumentServiceImpl();
    customerDocumentServiceImpl.setCustomerService(SpringContext.getBean(CustomerService.class));
    customerDocumentServiceImpl.setDataDictionaryService(SpringContext.getBean(DataDictionaryService.class));
    customerDocumentServiceImpl.setDocumentService(SpringContext.getBean(DocumentService.class));
    customerDocumentServiceImpl.setMaintenanceDocumentDictionaryService(SpringContext.getBean(MaintenanceDocumentDictionaryService.class));
    customerDocumentServiceImpl.setKualiModuleService(SpringContext.getBean(KualiModuleService.class));
    customerDocumentServiceImpl.setWorkflowDocumentService(SpringContext.getBean(WorkflowDocumentService.class));

    dataDictionaryService = SpringContext.getBean(DataDictionaryService.class);

    characters = new char[52];
    int count = 0;
    for (char i = 'A'; i <= 'Z'; i++) {
        characters[count] = i;
        count += 1;
    }
    for (char i = 'a'; i <= 'z'; i++) {
        characters[count] = i;
        count += 1;
    }

    rand = new Random();
}
 
开发者ID:kuali,项目名称:kfs,代码行数:26,代码来源:CustomerDocumentServiceImplTest.java

示例7: getActiveActionRequestsForCriteria

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * Retrieves the active action requests for the given criteria
 *
 * @param documentNumber
 * @param nodeName
 * @param user
 * @return List of action requests
 * @throws WorkflowException
 */
protected List<ActionRequest> getActiveActionRequestsForCriteria(String documentNumber, String nodeName, Person user) throws WorkflowException {
    if ( StringUtils.isBlank(documentNumber) ) {
        // throw exception
    }
    org.kuali.rice.kew.api.document.WorkflowDocumentService workflowDocService = KewApiServiceLocator.getWorkflowDocumentService();
    List<ActionRequest> actionRequests = workflowDocService.getActionRequestsForPrincipalAtNode(documentNumber, nodeName, user.getPrincipalId());
    List<ActionRequest> activeRequests = new ArrayList<ActionRequest>();
    for (ActionRequest actionRequest : actionRequests) {
        // identify which requests for the given node name can be satisfied by an action by this user
        if (actionRequest.isActivated()) {
            activeRequests.add(actionRequest);
        }
    }
    return activeRequests;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:25,代码来源:PurApWorkflowIntegrationServiceImpl.java

示例8: doRouteStatusChange

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.document.DocumentBase#doRouteStatusChange()
 */
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
    LOG.debug("doRouteStatusChange() started");
    super.doRouteStatusChange(statusChangeEvent);

    try {
        // DOCUMENT PROCESSED
        if (this.getFinancialSystemDocumentHeader().getWorkflowDocument().isProcessed()) {
            updateAndSaveAppDocStatus(PurapConstants.CreditMemoStatuses.APPDOC_COMPLETE);

            return;
        }
        // DOCUMENT DISAPPROVED
        else if (this.getFinancialSystemDocumentHeader().getWorkflowDocument().isDisapproved()) {
            String nodeName = SpringContext.getBean(WorkflowDocumentService.class).getCurrentRouteLevelName(this.getFinancialSystemDocumentHeader().getWorkflowDocument());

            String disapprovalStatus = CreditMemoStatuses.getCreditMemoAppDocDisapproveStatuses().get(nodeName);

            if (((StringUtils.isBlank(disapprovalStatus)) && ((CreditMemoStatuses.APPDOC_INITIATE.equals(getApplicationDocumentStatus())) || (CreditMemoStatuses.APPDOC_IN_PROCESS.equals(getApplicationDocumentStatus()))))) {
                disapprovalStatus = CreditMemoStatuses.APPDOC_CANCELLED_IN_PROCESS;
                updateAndSaveAppDocStatus(disapprovalStatus);
            }
            if (StringUtils.isNotBlank(disapprovalStatus)) {
                SpringContext.getBean(AccountsPayableService.class).cancelAccountsPayableDocument(this, nodeName);
            } else {
                logAndThrowRuntimeException("No status found to set for document being disapproved in node '" + nodeName + "'");
            }
        }
        // DOCUMENT CANCELED
        else if (this.getFinancialSystemDocumentHeader().getWorkflowDocument().isCanceled()) {
            String currentNodeName = this.getFinancialSystemDocumentHeader().getWorkflowDocument().getCurrentNodeNames().iterator().next();
            SpringContext.getBean(AccountsPayableService.class).cancelAccountsPayableDocument(this, currentNodeName);
        }
    } catch (Exception e) {
        logAndThrowRuntimeException("Error saving routing data while saving document with id " + getDocumentNumber(), e);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:41,代码来源:VendorCreditMemoDocument.java

示例9: superUserApproveAllActionRequests

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * Performs a super user approval of all action requests.
 *
 * @param superUser
 * @param documentNumber
 * @param nodeName
 * @param user
 * @param annotation
 * @throws WorkflowException
 */
protected void superUserApproveAllActionRequests(Person superUser, String documentNumber, String nodeName, Person user, String annotation) throws WorkflowException {
    WorkflowDocument workflowDoc = workflowDocumentService.loadWorkflowDocument(documentNumber, superUser);
    List<ActionRequest> actionRequests = getActiveActionRequestsForCriteria(documentNumber, nodeName, user);
    for (ActionRequest actionRequestDTO : actionRequests) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Active Action Request list size to process is " + actionRequests.size());
            LOG.debug("Attempting to super user approve action request with id " + actionRequestDTO.getId());
        }
        SpringContext.getBean(org.kuali.rice.kew.routeheader.service.WorkflowDocumentService.class).superUserActionRequestApproveAction(superUser.getPrincipalId(), documentNumber, actionRequestDTO.getId(), annotation, true);
        break;
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:23,代码来源:PurApWorkflowIntegrationServiceImpl.java

示例10: updateAndSaveAppDocStatus

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * Updates status of this document and saves the workflow data
 *
 * @param applicationDocumentStatus is the app doc status to save
 * @throws WorkflowException
 */
public void updateAndSaveAppDocStatus(String applicationDocumentStatus) throws WorkflowException {
   setApplicationDocumentStatus(applicationDocumentStatus);
   // if the document is Initiated, then it has not been saved yet
   // So, we don't need to save the routing data since the document
   // has not been submitted to the workflow engine yet
   if ( !getWorkflowDocument().isInitiated() ) {
       SpringContext.getBean(WorkflowDocumentService.class).saveRoutingData(getWorkflowDocument());
   }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:16,代码来源:FinancialSystemDocumentHeader.java

示例11: waitForNodeChange

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
public static void waitForNodeChange(String documentNumber, String desiredNodeName) throws Exception {
    LOG.info("Entering: waitForNodeChange(" + documentNumber + "," + desiredNodeName + ")");
    DocumentWorkflowNodeMonitor monitor = new DocumentWorkflowNodeMonitor(documentNumber, desiredNodeName);
    boolean success = ChangeMonitor.waitUntilChange(monitor, MAX_WAIT_SECONDS, INITIAL_PAUSE_SECONDS);
    if ( !success ) {
        WorkflowDocument document = SpringContext.getBean(WorkflowDocumentService.class).loadWorkflowDocument(documentNumber, UserNameFixture.ole.getPerson() );
        Assert.fail( "waitForNodeChange(" + documentNumber + "," + desiredNodeName + ") timed out. Document was " + document.getStatus() + " at the " + document.getCurrentNodeNames() + " node.\n" + document.getRequestedActions() );
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:10,代码来源:WorkflowTestUtils.java

示例12: waitForStatusChange

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
public static void waitForStatusChange( String documentNumber, DocumentStatus... desiredStatuses ) {
    try {
        LOG.info("Entering: waitForStatusChange(" + MAX_WAIT_SECONDS + "," + documentNumber + "," + Arrays.toString(desiredStatuses) + ")");
        DocumentWorkflowStatusMonitor monitor = new DocumentWorkflowStatusMonitor(documentNumber, desiredStatuses);
        if ( !ChangeMonitor.waitUntilChange(monitor, MAX_WAIT_SECONDS, INITIAL_PAUSE_SECONDS) ) {
            WorkflowDocument document = SpringContext.getBean(WorkflowDocumentService.class).loadWorkflowDocument(documentNumber, UserNameFixture.ole.getPerson() );
            Assert.fail( "waitForStatusChange(" + documentNumber + "," + Arrays.toString(desiredStatuses) + ") timed out. Document was in " + document.getStatus() + " state.\nNodes: " + document.getCurrentNodeNames() + "\nActions Requested:" + document.getRootActionRequests() );
        }
    } catch (Exception ex) {
        LOG.error("An exception was thrown while checking workflow status on document " + documentNumber + ", unable to continue.", ex );
        Assert.fail( "An exception was thrown while checking workflow status on document " + documentNumber + ", unable to continue." + ex.getClass() + " : " + ex.getMessage() );
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:14,代码来源:WorkflowTestUtils.java

示例13: waitForApproveRequest

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
public static void waitForApproveRequest(String documentNumber, Person user) throws Exception {
    LOG.info("Entering: waitForApproveRequest(" + documentNumber + "," + user.getPrincipalName() + ")");
    DocumentWorkflowRequestMonitor monitor = new DocumentWorkflowRequestMonitor(documentNumber, user, ActionRequestType.APPROVE);
    boolean success = ChangeMonitor.waitUntilChange(monitor, MAX_WAIT_SECONDS, INITIAL_PAUSE_SECONDS);
    if ( !success ) {
        WorkflowDocument document = SpringContext.getBean(WorkflowDocumentService.class).loadWorkflowDocument(documentNumber, UserNameFixture.ole.getPerson() );
        Assert.fail( "waitForApproveRequest(" + documentNumber + "," + user.getPrincipalName() + ") timed out. Document was in " + document.getStatus() + " state.\n" + document.getCurrentNodeNames() + "\n" + document.getRootActionRequests() );
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:10,代码来源:WorkflowTestUtils.java

示例14: valueChanged

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
@Override
public boolean valueChanged() throws Exception {
    WorkflowDocument document = SpringContext.getBean(WorkflowDocumentService.class).loadWorkflowDocument(documentNumber, UserNameFixture.ole.getPerson() );

    DocumentStatus currentStatus = document.getStatus();

    for ( DocumentStatus desiredState : desiredWorkflowStates ) {
        if (desiredState.equals(currentStatus)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:14,代码来源:DocumentWorkflowStatusMonitor.java

示例15: populate

import org.kuali.rice.krad.workflow.service.WorkflowDocumentService; //导入依赖的package包/类
/**
 * @see org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase#populate(javax.servlet.http.HttpServletRequest)
 */
@Override
public void populate(HttpServletRequest request) {
    super.populate(request);

      if (hasDocumentId()) {
        CashControlDocument ccDoc = getCashControlDocument();

        // apply populate to PaymentApplicationDocuments
        for (CashControlDetail cashControlDetail : ccDoc.getCashControlDetails()) {
            if ( !cashControlDetail.getReferenceFinancialDocument().getDocumentHeader().hasWorkflowDocument() ) {
                // populate workflowDocument in documentHeader, if needed
                try {
                    WorkflowDocument workflowDocument = SpringContext.getBean(SessionDocumentService.class).getDocumentFromSession(GlobalVariables.getUserSession(), cashControlDetail.getReferenceFinancialDocumentNumber());

                    if (workflowDocument == null) {
                        // gets the workflow document from doc service
                        workflowDocument = SpringContext.getBean(WorkflowDocumentService.class).loadWorkflowDocument(cashControlDetail.getReferenceFinancialDocumentNumber(), GlobalVariables.getUserSession().getPerson() );
                        SpringContext.getBean(SessionDocumentService.class).addDocumentToUserSession(GlobalVariables.getUserSession(), workflowDocument);
                        if (workflowDocument == null) {
                            throw new WorkflowException("Unable to get retrieve document # " + cashControlDetail.getReferenceFinancialDocumentNumber() + " from document service getByDocumentHeaderId");
                        }
                    }

                    cashControlDetail.getReferenceFinancialDocument().getDocumentHeader().setWorkflowDocument(workflowDocument);
                }
                catch (WorkflowException e) {
                    LOG.warn("Error while instantiating workflowDoc: " + cashControlDetail.getReferenceFinancialDocumentNumber(), e);
                    throw new RuntimeException("error populating documentHeader.workflowDocument", e);
                }
            }
        }
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:37,代码来源:CashControlDocumentForm.java


注:本文中的org.kuali.rice.krad.workflow.service.WorkflowDocumentService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。