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


Java WorkflowDocument.revokeAdHocRequestById方法代码示例

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


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

示例1: testRevokePriorToRouting

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests the behavior revocation of ad hoc requests prior to the routing of the document.
 *
 * @throws Exception
 */
@Test public void testRevokePriorToRouting() throws Exception {
	// ad hoc the document to dewey and the workgroup WorkflowAdmin
	WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), ADH0C_DOC);
	docId = doc.getDocumentId();
	doc.adHocToPrincipal(ActionRequestType.APPROVE, "AdHoc", "annotation1", getPrincipalIdForName("dewey"), "respDesc1", false);

	doc = getDocument("dewey");
	assertFalse("User andlee should not have an approve request yet.  Document not yet routed.", doc.isApprovalRequested());
	String groupId = getGroupIdForName(KimConstants.KIM_GROUP_WORKFLOW_NAMESPACE_CODE, "WorkflowAdmin");
	doc.adHocToGroup(ActionRequestType.APPROVE, "AdHoc", "annotation2", groupId , "respDesc2", true);
	doc = getDocument("quickstart");
	assertFalse("User should not have approve request yet.  Document not yet routed.", doc.isApprovalRequested());

	// the document should be initiated at this point
	assertTrue("Document should still be intitiated.", doc.isInitiated());

	// check and revoke the actual ActionRequestVOs
	// reaquire the document as the initiator
	doc = getDocument("rkirkend");
	List<ActionRequest> actionRequestVOs = KewApiServiceLocator.getWorkflowDocumentService().getRootActionRequests(doc.getDocumentId());
	assertEquals("There should be 2 ad hoc requests.", 2, actionRequestVOs.size());
	for (ActionRequest requestVO : actionRequestVOs) {
		assertTrue("Should be an ad hoc request.", requestVO.isAdHocRequest());
		// revoke by id
		doc.revokeAdHocRequestById(requestVO.getId().toString(), "");
	}

	// now the document should have no pending action requests on it
	List actionRequests = KEWServiceLocator.getActionRequestService().findPendingByDoc(docId);
	assertEquals("There should be no pending requests.", 0, actionRequests.size());

	// check that the "ActionTakens" have been properly recorded
	Collection<ActionTakenValue> actionTakens = KEWServiceLocator.getActionTakenService().findByDocumentId(docId);
    // count how many are AdhocRevoked
    int numAdhocRevoked = 0;
    for (ActionTakenValue actionTaken : actionTakens) {
        if (actionTaken.getActionTaken().equals(KewApiConstants.ACTION_TAKEN_ADHOC_REVOKED_CD)) {
            numAdhocRevoked++;
        }
    }
	assertEquals("There should be 2 'AdHocRevoked' action takens", 2, numAdhocRevoked);

	// now check that the document is still intiated
	doc = getDocument("rkirkend");
	assertTrue("Document should still be intitiated.", doc.isInitiated());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:52,代码来源:RevokeAdHocActionTest.java


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