本文整理汇总了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());
}