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


Java WorkflowDocument.getRequestedActions方法代码示例

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


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

示例1: 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

示例2: testSearching

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testSearching() throws InterruptedException {
    String documentTypeName = "TestAppDocStatusDoc1";

    String initiatorNetworkId = "rkirkend";
    Person initiator = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(initiatorNetworkId);
    String approverNetworkId = "bmcgough";
    Person approver = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(approverNetworkId);
    String travelerNetworkId = "temay";
    Person traveler = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(travelerNetworkId);

    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(initiator.getPrincipalId(), documentTypeName);
    workflowDocument.setTitle("Routing style");

    // no status, not routed
    assertAppDocStatuses(workflowDocument.getDocumentId(), new String [] { });
    assertSearchStatus(documentTypeName, initiator, "Approval in Progress", 0, 0);
    assertSearchStatus(documentTypeName, initiator, "Submitted", 0, 0);

    workflowDocument.route("routing this document.");

    DocumentRouteHeaderValue drhv = KEWServiceLocator.getRouteHeaderService().getRouteHeader(workflowDocument.getDocumentId());
    
    // should be in approval status
    assertAppDocStatuses(workflowDocument.getDocumentId(), new String [] { "Approval in Progress" });
    assertSearchStatus(documentTypeName, initiator, "Approval in Progress", 1, 0); // one document currently in "Approval in Progress" status
    assertSearchStatus(documentTypeName, initiator, "Approval in Progress", 1, drhv.getRouteStatusDate().getTime()); // one transition to "Approval in Progress" status around the time of routing
    assertSearchStatus(documentTypeName, initiator, "Submitted", 0, 0); // none in "Submitted" status

    // approve it out of the "Approval in Progress" state
    workflowDocument = WorkflowDocumentFactory.loadDocument(approver.getPrincipalId(), workflowDocument.getDocumentId());
    RequestedActions actions = workflowDocument.getRequestedActions();
    assertTrue(actions.isApproveRequested());
    workflowDocument.approve("destination approval");

    assertAppDocStatuses(workflowDocument.getDocumentId(), new String [] { "Approval in Progress", "Submitted" });
    assertSearchStatus(documentTypeName, approver, "Approval in Progress", 0, 0); // no documents currently in "Approval in Progress" status
    assertSearchStatus(documentTypeName, approver, "Approval in Progress", 1, drhv.getRouteStatusDate().getTime()); // one transition to "Approval in Progress" status around the time of routing
    assertSearchStatus(documentTypeName, approver, "Submitted", 1, 0); // one document currently in "Submitted" status
    assertSearchStatus(documentTypeName, approver, "Submitted", 1, drhv.getDateLastModified().getMillis()); // one transition to "Submitted" status around the time of approval

    // approve it out of the "Approval in Progress" state
    workflowDocument = WorkflowDocumentFactory.loadDocument(traveler.getPrincipalId(), workflowDocument.getDocumentId());
    actions = workflowDocument.getRequestedActions();
    assertTrue(actions.isApproveRequested());
    workflowDocument.approve("travel approval");

    // no final status, so no transition
    assertAppDocStatuses(workflowDocument.getDocumentId(), new String [] { "Approval in Progress", "Submitted" });
    assertSearchStatus(documentTypeName, traveler, "Approval in Progress", 0, 0); // no documents currently in "Approval in Progress" status
    assertSearchStatus(documentTypeName, traveler, "Approval in Progress", 1, drhv.getRouteStatusDate().getTime()); // one transition to "Approval in Progress" status around the time of routing
    assertSearchStatus(documentTypeName, traveler, "Submitted", 1, 0); // one document currently in "Submitted" status
    assertSearchStatus(documentTypeName, traveler, "Submitted", 1, drhv.getDateLastModified().getMillis()); // one transition to "Submitted" status around the time of approval
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:54,代码来源:AppDocStatusTest.java

示例3: testAppDocResetAfterAdHoc

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testAppDocResetAfterAdHoc() throws Exception {
    String documentTypeName = "TestAppDocStatusDoc1";

    String initiatorNetworkId = "rkirkend";
    String approverNetworkId = "bmcgough";
    String travelerNetworkId = "temay";

    Person initiator = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(initiatorNetworkId);
    Person approver = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(approverNetworkId);
    Person traveler = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(travelerNetworkId);

    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(initiator.getPrincipalId(), documentTypeName);
    workflowDocument.setTitle("Routing style");
    workflowDocument.route("routing this document.");

    //DocumentRouteHeaderValue drhv = KEWServiceLocator.getRouteHeaderService().getRouteHeader(workflowDocument.getDocumentId());
    
    // should be in approval status
    assertAppDocStatuses(workflowDocument.getDocumentId(), new String [] { "Approval in Progress" });

    // approve it out of the "Approval in Progress" state
    
    workflowDocument = WorkflowDocumentFactory.loadDocument(approver.getPrincipalId(), workflowDocument.getDocumentId());
    Document staleWorkflowDocument = KewApiServiceLocator.getWorkflowDocumentService().getDocument(workflowDocument.getDocumentId());
    
    assertEquals( "app doc status incorrect before final approval: " + staleWorkflowDocument, "Approval in Progress", staleWorkflowDocument.getApplicationDocumentStatus() );

    RequestedActions actions = workflowDocument.getRequestedActions();
    assertTrue(actions.isApproveRequested());
    workflowDocument.approve("destination approval");


    // approve it out of the "Approval in Progress" state
    workflowDocument = WorkflowDocumentFactory.loadDocument(traveler.getPrincipalId(), workflowDocument.getDocumentId());
    assertEquals( "current app doc status incorrect after 1st approval", "Submitted", workflowDocument.getApplicationDocumentStatus() );

    actions = workflowDocument.getRequestedActions();
    assertTrue(actions.isApproveRequested());
    workflowDocument.approve("travel approval");

    workflowDocument = WorkflowDocumentFactory.loadDocument(traveler.getPrincipalId(), workflowDocument.getDocumentId());

    assertEquals( "app doc status in 'stale' WorkflowDocument retrieved before approval should still have original status", "Approval in Progress", staleWorkflowDocument.getApplicationDocumentStatus() );
    
    Document newWorkflowDocument = KewApiServiceLocator.getWorkflowDocumentService().getDocument(workflowDocument.getDocumentId());
    
    assertEquals( "current API app doc status incorrect after 2nd approval", "Submitted", newWorkflowDocument.getApplicationDocumentStatus() );
    
    WorkflowDocumentPrototype prototype = KEWServiceLocator.getWorkflowDocumentPrototype();
    prototype.init(traveler.getPrincipalId(), staleWorkflowDocument);
    prototype.setTitle(prototype.getTitle());
    prototype.adHocToPrincipal(AdHocToPrincipal.Builder.create(ActionRequestType.FYI, null, initiator.getPrincipalId()).build(), "FYI to initiator");
    
    workflowDocument = WorkflowDocumentFactory.loadDocument(traveler.getPrincipalId(), workflowDocument.getDocumentId());

    assertEquals( "current app doc status incorrect after adhoc", "Submitted", workflowDocument.getApplicationDocumentStatus() );
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:58,代码来源:AppDocStatusTest.java


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