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


Java WorkflowDocument.disapprove方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.api.WorkflowDocument.disapprove方法的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocument.disapprove方法的具体用法?Java WorkflowDocument.disapprove怎么用?Java WorkflowDocument.disapprove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.api.WorkflowDocument的用法示例。


在下文中一共展示了WorkflowDocument.disapprove方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: disapprove

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Override
public void disapprove(WorkflowDocument workflowDocument, String annotation) throws WorkflowException {
    if (LOG.isDebugEnabled()) {
        LOG.debug("disapproving document(" + workflowDocument.getDocumentId() + ",'" + annotation + "')");
    }

    workflowDocument.disapprove(annotation);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:WorkflowDocumentServiceImpl.java

示例2: administerEventNotificationMessage

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * This method handles approval/disapproval/acknowledgement of the notification request
 * @param request the HttpServletRequest
 * @param response the HttpServletResponse
 * @param command the command object bound for this MultiActionController
 * @throws ServletException
 */
private void administerEventNotificationMessage(HttpServletRequest request, HttpServletResponse response, AdministerNotificationRequestCommand command, String action) throws ServletException {
    LOG.debug("remoteUser: " + request.getRemoteUser());

    BindException bindException = new BindException(command, "command");
    ValidationUtils.rejectIfEmpty(bindException, "docId", "Document id must be specified");
    if (bindException.hasErrors()) {
        throw new ServletRequestBindingException("Document id must be specified", bindException);
    }

    // obtain a workflow user object first
    //WorkflowIdDTO user = new WorkflowIdDTO(request.getRemoteUser());
    String userId = request.getRemoteUser();

    try {
        // now construct the workflow document, which will interact with workflow
        WorkflowDocument document = NotificationWorkflowDocument.loadNotificationDocument(userId, command.getDocId());

        NotificationBo notification = retrieveNotificationForWorkflowDocument(document);

        String initiatorPrincipalId = document.getInitiatorPrincipalId();
        Person initiator = KimApiServiceLocator.getPersonService().getPerson(initiatorPrincipalId);
        String notificationBlurb =  notification.getContentType().getName() + " notification submitted by " + initiator.getName() + " for channel " + notification.getChannel().getName();
        if ("disapprove".equals(action)) {
            document.disapprove("User " + userId + " disapproving " + notificationBlurb);
        } else if ("approve".equals(action)) {
            document.approve("User " + userId + " approving " + notificationBlurb);
        } else if ("acknowledge".equals(action)) {
            document.acknowledge("User " + userId + " acknowledging " + notificationBlurb);
        }
    } catch (Exception e) {
        LOG.error("Exception occurred taking action on notification request", e);
        throw new ServletException("Exception occurred taking action on notification request", e);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:42,代码来源:AdministerNotificationRequestController.java

示例3: testInitiatorRoleDisapprove

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests whether the initator who disapproved a doc gets an acknowledgement
 *
 */
@Test public void testInitiatorRoleDisapprove() throws WorkflowException {
    // test initiator disapproval of their own doc via InitiatorRoleAttribute
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("arh14"), "InitiatorRoleApprovalTest");
    document.route("routing document");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("arh14"), document.getDocumentId());
    document.disapprove("disapproving the document");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("arh14"), document.getDocumentId());
    assertFalse("Initiator should not have an Ack request from disapproval because they were the disapprover user", document.isAcknowledgeRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:DisapproveActionTest.java

示例4: testInitiatorDisapprove

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests whether the initiator who disapproved a doc gets an acknowledgement
 * 
 */
@Test public void testInitiatorDisapprove() throws WorkflowException {
    // test initiator disapproval, via normal request with forceAction=true
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), NotifySetup.DOCUMENT_TYPE_NAME);
    document.route("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
    document.disapprove("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
    assertFalse("Initiator should not have an Ack request from disapproval because they were the disapprover user", document.isAcknowledgeRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:DisapproveActionTest.java

示例5: testDisapproveByArbitraryRecipient

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testDisapproveByArbitraryRecipient() throws WorkflowException {
    // test approval by some other person
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "BlanketApproveSequentialTest");
    document.route("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
    document.disapprove("disapproving as bmcgough");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
    assertFalse("Acknowledge was incorrectly sent to non-initiator disapprover", document.isAcknowledgeRequested());

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
    assertTrue("Acknowledge was not sent to initiator", document.isAcknowledgeRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:DisapproveActionTest.java

示例6: testDocumentStatusSearching

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests searching on document status and document status category
 */
@Test public void testDocumentStatusSearching() {
    String dt = "SearchDocType";
    String pid = getPrincipalIdForName("quickstart");
    WorkflowDocument initiated = WorkflowDocumentFactory.createDocument(pid, dt);
    WorkflowDocument saved = WorkflowDocumentFactory.createDocument(pid, dt);
    saved.saveDocument("saved");
    assertEquals(DocumentStatus.SAVED, saved.getStatus());

    WorkflowDocument enroute = WorkflowDocumentFactory.createDocument(pid, dt);
    enroute.route("routed");
    assertEquals(DocumentStatus.ENROUTE, enroute.getStatus());

    WorkflowDocument exception = WorkflowDocumentFactory.createDocument(pid, dt);
    exception.route("routed");
    exception.placeInExceptionRouting("placed in exception routing");
    assertEquals(DocumentStatus.EXCEPTION, exception.getStatus());

    // no acks on this doc, can't test?
    //WorkflowDocument processed = WorkflowDocumentFactory.createDocument(pid, dt);
    //processed.route("routed");

    WorkflowDocument finl = WorkflowDocumentFactory.createDocument(pid, dt);
    finl.route("routed");
    finl.switchPrincipal(getPrincipalId("jhopf"));
    finl.approve("approved");
    assertEquals(DocumentStatus.FINAL, finl.getStatus());

    WorkflowDocument canceled = WorkflowDocumentFactory.createDocument(pid, dt);
    canceled.cancel("canceled");
    assertEquals(DocumentStatus.CANCELED, canceled.getStatus());

    WorkflowDocument disapproved = WorkflowDocumentFactory.createDocument(pid, dt);
    disapproved.route("routed");
    disapproved.switchPrincipal(getPrincipalId("jhopf"));
    RequestedActions ra = disapproved.getRequestedActions();
    disapproved.disapprove("disapproved");
    assertEquals(DocumentStatus.DISAPPROVED, disapproved.getStatus());

    assertDocumentStatuses(dt, pid, 1, 1, 1, 1, 0, 1, 1, 1);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:44,代码来源:DocumentSearchTest.java

示例7: testHierarchyRoutingNodeUnevenApprovalDisapprove

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test
public void testHierarchyRoutingNodeUnevenApprovalDisapprove() throws WorkflowException {
    loadXmlFile("HierarchyRoutingNodeConfig.xml");
    
    WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("arh14"), "HierarchyDocType");
    
    doc.setApplicationContent(HIERARCHY);
    doc.route("initial route");
    
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user2", "user1", "temay", "jhopf" }, true);
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user3", "quickstart", "dewey" }, false);
    
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user2"), doc.getDocumentId());
    doc.approve("approving as user2");
    
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user1", "temay", "jhopf" }, true);
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user2", "user3", "quickstart", "dewey" }, false);
    
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), doc.getDocumentId());
    doc.approve("approving as jhopf");
    
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user1", "temay" }, true);
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "jhopf", "user2", "user3", "quickstart", "dewey" }, false);
    
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user1"), doc.getDocumentId());
    doc.approve("approving as user1");
    
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user3", "temay" }, true);
    TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user1", "jhopf", "user2", "quickstart", "dewey" }, false);
    
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user3"), doc.getDocumentId());
    doc.disapprove("disapproving as user3");
    
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("arh14"), doc.getDocumentId());

    //TestUtilities.assertApprovals(doc.getDocumentId(), new String[] { "user3", "temay", "user1", "jhopf", "user2", "quickstart", "dewey" }, false);

    assertTrue(doc.isDisapproved());
 
    TestUtilities.logActionRequests(doc.getDocumentId());

    // these are ok, these are the ACKs for the previous approvers
    int numActionRequests = KEWServiceLocator.getActionRequestService().findPendingByDoc(doc.getDocumentId()).size();
    assertEquals("Incorrect number of action requests", 4, numActionRequests);
    int numActionItems = KEWServiceLocator.getActionListService().findByDocumentId(doc.getDocumentId()).size();
    assertEquals("Incorrect number of action items.", 4, numActionItems);
    
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user2"), doc.getDocumentId());
    doc.acknowledge("acknowledging disapproval as user2");
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), doc.getDocumentId());
    doc.acknowledge("acknowledging disapproval as jhopf");
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user1"), doc.getDocumentId());
    doc.acknowledge("acknowledging disapproval as user1");
    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("arh14"), doc.getDocumentId());
    doc.acknowledge("acknowledging disapproval as arh14");
    
    assertTrue(doc.isDisapproved());

    numActionRequests = KEWServiceLocator.getActionRequestService().findPendingByDoc(doc.getDocumentId()).size();
    assertEquals("Incorrect number of action requests", 0, numActionRequests);
    numActionItems = KEWServiceLocator.getActionListService().findByDocumentId(doc.getDocumentId()).size();
    assertEquals("Incorrect number of action items.", 0, numActionItems);
    
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:65,代码来源:HierarchyRoutingNodeTest.java

示例8: takeAction

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
public static void takeAction(WorkflowDocument document, Document dom, EDLContext edlContext)
        throws WorkflowException {
    RequestParser requestParser = edlContext.getRequestParser();
    UserAction userAction = edlContext.getUserAction();
    String annotation = requestParser.getParameterValue("annotation");
    String action = userAction.getAction();
    String previousNodeName = requestParser.getParameterValue("previousNode");

    if (!userAction.isValidatableAction()) {
        // if the action's not validatable, clear the attribute definitions because we don't want to end up executing validateClientRoutingData()
        // TODO the problem here is that the XML is still updated on a cancel so we end up without any attribute content in the document content
        document.clearAttributeDefinitions();
    }

    boolean actionTaken = true;

    if (UserAction.ACTION_ROUTE.equals(action)) {
        document.route(annotation);
    }else if(UserAction.ACTION_CREATE.equals(action)){
           document.saveDocumentData();
    }
    else if (UserAction.ACTION_APPROVE.equals(action)) {
        document.approve(annotation);
    } else if (UserAction.ACTION_DISAPPROVE.equals(action)) {
        document.disapprove(annotation);
    } else if (UserAction.ACTION_CANCEL.equals(action)) {
        document.cancel(annotation);
    } else if (UserAction.ACTION_BLANKETAPPROVE.equals(action)) {
        document.blanketApprove(annotation);
    } else if (UserAction.ACTION_FYI.equals(action)) {
        document.fyi();
    } else if (UserAction.ACTION_ACKNOWLEDGE.equals(action)) {
        document.acknowledge(annotation);
    } else if (UserAction.ACTION_SAVE.equals(action)) {
        if (document.getStatus().equals(DocumentStatus.INITIATED)) {
            document.saveDocument(annotation);
        } else {
            document.saveDocumentData();
        }
    } else if (UserAction.ACTION_COMPLETE.equals(action)) {
        document.complete(annotation);
    } else if (UserAction.ACTION_DELETE.equals(action)) {
        document.delete();
    } else if (UserAction.ACTION_RETURN_TO_PREVIOUS.equals(action)) {
        document.returnToPreviousNode(annotation, previousNodeName);
    } else {
        actionTaken = false;
    }

    if (actionTaken) {
        Element actionTakenElement = EDLXmlUtils.getOrCreateChildElement(dom.getDocumentElement(), ACTION_TAKEN,
                true);
        actionTakenElement.appendChild(dom.createTextNode(action));
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:56,代码来源:WorkflowDocumentActions.java


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