• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WorkflowDocument类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: doPostProcessWork

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
private void doPostProcessWork(Document dom, EDLContext edlContext) throws Exception {
    RequestParser requestParser = edlContext.getRequestParser();
    // if the document is in error then we don't want to execute the action!
    if (edlContext.isInError()) {
        return;
    }
    WorkflowDocument document = (WorkflowDocument) edlContext.getRequestParser().getAttribute(
            RequestParser.WORKFLOW_DOCUMENT_SESSION_KEY);
    if (document == null) {
        return;
    }
    //strip out the data element
    Element dataElement = (Element) dom.getElementsByTagName(EDLXmlUtils.DATA_E).item(0);
    String docContent = XmlJotter.jotNode(dataElement);//use the transformer on edlcontext
    document.setApplicationContent(docContent);
    takeAction(document, dom, edlContext);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:WorkflowDocumentActions.java


示例2: testReturnToPreviousCorrectlyUpdatingDocumentStatus

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * Test that the document is being updated appropriately after a return to previous call
 *
 * @throws Exception
 */
@Test public void testReturnToPreviousCorrectlyUpdatingDocumentStatus() throws Exception {

    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "UnitTestDocument");
    document.route("");

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

    assertFalse("ewestfal should no longer have approval status", document.isApprovalRequested());
    assertFalse("ewestfal should no long have blanket approve status", document.isBlanketApproveCapable());

    //just for good measure
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertTrue("rkirkend should now have an approve request", document.isApprovalRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:WorkflowDocumentTest.java


示例3: superUserInitiatorDisapprove

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
protected void superUserInitiatorDisapprove(boolean notify) throws Exception {
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), notify ? DOC_TYPE_WITH_NOTIFY: DOC_TYPE);
       document.route("");
       
       WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId()).approve("");
       WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId()).approve("");
       WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId()).approve("");

       document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
       assertTrue("WorkflowDocument should indicate ewestfal as SuperUser", document.isValidAction(ActionType.SU_DISAPPROVE));
       document.superUserDisapprove("");
       assertTrue("Document should be final after Super User Disapprove", document.isDisapproved());
       if (notify) {
           assertTrue(WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId()).isAcknowledgeRequested());
           assertTrue(WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId()).isAcknowledgeRequested());
           // initiator doesn't get Ack for their own action
           assertFalse(WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId()).isAcknowledgeRequested());
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:SuperUserDisapproveTest.java


示例4: testGroupDelegator

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * This method tests that 
 * 
 * @throws Exception
 */
@Test
public void testGroupDelegator() throws Exception {
	
	RuleTestUtils.createDelegationToGroup("EmailTestWorkgroupDocType", "WorkflowDocumentTemplate", "EmailTestDelegateWorkgroup");
	
	String user1PrincipalId = getPrincipalIdForName("user1");
	
	// this document type has a group responsibility
	WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "EmailTestWorkgroupDocType");
	doc.route("");
	
	ActionListFilter actionListFilter = new ActionListFilter();
	actionListFilter.setDocumentType(doc.getDocumentTypeName());
	Collection<ActionItem> actionItems = KEWServiceLocator.getActionListService().getActionList(user1PrincipalId, actionListFilter);

	EmailContentService emailContentService = KEWServiceLocator.getEmailContentService();
	
	Person person = KimApiServiceLocator.getPersonService().getPerson(user1PrincipalId);
	EmailContent emailContent = emailContentService.generateDailyReminder(person, ActionItem.to(new ArrayList<ActionItem>(actionItems)));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:EmailContentServiceTest.java


示例5: testDocSearchSecurityPermissionDocType

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * Test for https://test.kuali.org/jira/browse/KULRICE-1968 - Document search fails when users are missing
 * Tests that we can safely search on docs whose initiator no longer exists in the identity management system
 * This test searches by doc type name criteria.
 * @throws Exception
 */
@Test public void testDocSearchSecurityPermissionDocType() throws Exception {
    String documentTypeName = "SecurityDoc_PermissionOnly";
    String userNetworkId = "arh14";
    // route a document to enroute and route one to final
    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalId(userNetworkId), documentTypeName);
    workflowDocument.setTitle("testDocSearch_PermissionSecurity");
    workflowDocument.route("routing this document.");

    Person user = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("edna");
    DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
    criteria.setDocumentTypeName(documentTypeName);
    DocumentSearchResults results = docSearchService.lookupDocuments(user.getPrincipalId(), criteria.build());
    assertEquals(0, results.getNumberOfSecurityFilteredResults());
    assertEquals("Search returned invalid number of documents", 1, results.getSearchResults().size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:DocumentSearchSecurityTest.java


示例6: testNewDelegationTriggersRequeue

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
*
* Tests that adding a delegation for a rule for which a document has a pending action request causes
* the document to be requeued. See KULRICE-3575
*
* @throws Exception
*/
  @Test public void testNewDelegationTriggersRequeue() throws Exception {
  	String docType = "RiceDocument.testNewDelegationTriggersRequeue";

  	// route a document of this type
  	WorkflowDocument wd = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), DOCTYPE);
  	wd.route("");

  	// clear the current set of requeued document ids
MockDocumentRefreshQueueImpl.clearRequeuedDocumentIds();

  	// create and save a rule delegation
RuleTestUtils.createDelegationToUser(DOCTYPE, RULE_TEMPLATE, DELEGATE_USER);

assertTrue("our document should have been requeued!",
		MockDocumentRefreshQueueImpl.getRequeuedDocumentIds().contains(wd.getDocumentId()));
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:AddRuleDelegationTest.java


示例7: testKimExceptionRoutingWithDocHierarchy

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * Checks to make sure that the KIM routing is working with hierarchical documents.
 * Based upon the test method org.kuali.rice.kew.doctype.DocumentTypeTest.testFinalApproverRouting()
 */
@Test public void testKimExceptionRoutingWithDocHierarchy() throws Exception {
	loadXmlFile("RouteExceptionTestDoc.xml");
	String[] docNames = {"TestFinalApproverDocumentType_Child", "TestFinalApproverDocumentType_GrandChild"};
	// Test the child doc and then the grandchild doc.
	for (int i = 0; i < docNames.length; i++) {
		// Perform the same steps as in the previous unit test.
		WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("admin"), docNames[i]);
        document.setTitle("");
        document.route("");
        document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
        try {
            document.approve("");
            fail("document should have thrown routing exception");
        } catch (Exception e) {
            //deal with single transaction issue in test.
        	TestUtilities.getExceptionThreader().join();
        	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
            assertTrue("Document should be in exception routing", document.isException());
        }
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:ExceptionRoutingServiceTest.java


示例8: testGetSearchableAttributeDateTimeValuesByKey

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
@Test public void testGetSearchableAttributeDateTimeValuesByKey() throws Exception {
    String documentTypeName = SeqSetup.DOCUMENT_TYPE_NAME;
    String userNetworkId = "ewestfal";
    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
    workflowDocument.setTitle("Respect my Authoritah");
    workflowDocument.route("routing this document.");
    userNetworkId = "rkirkend";
    WorkflowDocument workflowDocument2 = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
    workflowDocument2.setTitle("Routing Style");
    workflowDocument2.route("routing this document.");

    WorkflowDocumentService wds = KewApiServiceLocator.getWorkflowDocumentService();
    List<DateTime> dateTimes = wds.getSearchableAttributeDateTimeValuesByKey(workflowDocument.getDocumentId(), TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_KEY);
    assertNotNull("dateTimes should not be null", dateTimes);
    assertTrue("dateTimes should not be empty", !dateTimes.isEmpty());
    verifyTimestampToSecond(TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_VALUE_IN_MILLS, dateTimes.get(0).getMillis());

    dateTimes = wds.getSearchableAttributeDateTimeValuesByKey(workflowDocument2.getDocumentId(), TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_KEY);
    assertNotNull("dateTimes should not be null", dateTimes);
    assertTrue("dateTimes should not be empty", !dateTimes.isEmpty());
    verifyTimestampToSecond(TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_VALUE_IN_MILLS, dateTimes.get(0).getMillis());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:WorkflowUtilityTest.java


示例9: getByDocumentHeaderIdSessionless

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.service.DocumentService#getByDocumentHeaderIdSessionless(java.lang.String)
 */
@Override
public Document getByDocumentHeaderIdSessionless(String documentHeaderId) throws WorkflowException {
    if (documentHeaderId == null) {
        throw new IllegalArgumentException("invalid (null) documentHeaderId");
    }

    WorkflowDocument workflowDocument = null;

    if (LOG.isDebugEnabled()) {
        LOG.debug("Retrieving doc id: " + documentHeaderId + " from workflow service.");
    }

    Person person = getPersonService().getPersonByPrincipalName(KRADConstants.SYSTEM_USER);
    workflowDocument = workflowDocumentService.loadWorkflowDocument(documentHeaderId, person);

    Class<? extends Document> documentClass = getDocumentClassByTypeName(workflowDocument.getDocumentTypeName());

    // retrieve the Document
    Document document = getLegacyDataAdapter().findByDocumentHeaderId(documentClass, documentHeaderId);

    return postProcessDocument(documentHeaderId, workflowDocument, document);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:DocumentServiceImpl.java


示例10: testAdHocWithRequestLabel_ToGroup

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
@Test
public void testAdHocWithRequestLabel_ToGroup() throws Exception {
	WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("user1"), ADHOC_DOC);
	String label = "MY GROUP LABEL";
	Group workflowAdmin = KEWServiceLocator.getIdentityHelperService().getGroupByName("KR-WKFLW", "WorkflowAdmin");
	doc.adHocToGroup(ActionRequestType.APPROVE, null, "", workflowAdmin.getId(), "", true, label);
	
	List<ActionRequestValue> actionRequests = KEWServiceLocator.getActionRequestService().findPendingRootRequestsByDocId(doc.getDocumentId());
	assertEquals("Should have 1 request.", 1, actionRequests.size());
	ActionRequestValue actionRequest = actionRequests.get(0);
	assertEquals("Should be an approve request", ActionRequestType.APPROVE.getCode(), actionRequest.getActionRequested());
	assertEquals("Invalid request label", label, actionRequest.getRequestLabel());
	assertEquals("Request should be initialized", ActionRequestStatus.INITIALIZED.getCode(), actionRequest.getStatus());
	
	// now route the document, it should activate the request and create action items
	doc.route("");
	
	Collection<ActionItem> actionItems = KEWServiceLocator.getActionListService().getActionListForSingleDocument(doc.getDocumentId());
	assertTrue("Should have more than 1 action item.", actionItems.size() > 1);
	for (ActionItem actionItem : actionItems) {
		assertEquals("ActionItem should be constructed from request.", actionRequest.getActionRequestId(), actionItem.getActionRequestId());
		assertEquals("ActionItem should have same label", label, actionItem.getRequestLabel());
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:AdHocRouteTest.java


示例11: testNonMatchingExtensionKey

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * Tests SGXA attribute matching behavior with extension value keys that do not necessarily match
 * a field defined in the attribute
 */
@Test public void testNonMatchingExtensionKey() throws WorkflowException {
    loadXmlFile("TestExtensionValueMatching.xml");
    WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("arh14"), "TestDocument");

    WorkflowAttributeDefinition.Builder attr = WorkflowAttributeDefinition.Builder.create(StandardGenericXMLRuleAttribute.class.getName());
    attr.setAttributeName("Attr1");
    // expected to match RuleTemplate with extension value: value='1' with xpath expression /xmlRouting/field[@name=attr1] = wf:ruledata('value')
    attr.addPropertyDefinition("attr1", "2");
    doc.addAttributeDefinition(attr.build());

    doc.route("");

    String id = doc.getDocumentId();

    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user1"), id);
    assertTrue("Request should have been generated to user1", doc.isApprovalRequested());

    doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user2"), id);
    assertTrue("Expected approval request to user2", doc.isApprovalRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:StandardGenericXMLRuleAttributeTest.java


示例12: clearAllFyisAndAcknowledgeNotificationWorkflowDocument

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * @see org.kuali.rice.ken.service.NotificationWorkflowDocumentService#clearAllFyisAndAcknowledgeNotificationWorkflowDocument(java.lang.String,
 *      org.kuali.rice.ken.document.kew.NotificationWorkflowDocument, java.lang.String)
 */
public void clearAllFyisAndAcknowledgeNotificationWorkflowDocument(String initiatorUserId,
        WorkflowDocument workflowDocument, String annotation) {
    List<ActionRequest> reqs = workflowDocument.getRootActionRequests();
    for (int i = 0; i < reqs.size(); i++) {
        LOG.info("Action Request[" + i + "] = " + reqs.get(i).getActionRequested());
        if (reqs.get(i).getActionRequested().equals(ActionRequestType.ACKNOWLEDGE)) {
            workflowDocument.acknowledge(annotation);
        } else if (reqs.get(i).getActionRequested().equals(ActionRequestType.FYI)) {
            workflowDocument.logAnnotation(annotation);
            workflowDocument.fyi();
        } else {
            throw new WorkflowRuntimeException("Invalid notification action request in workflow document ("
                    + workflowDocument.getDocumentId()
                    + ") was encountered.  Should be either an acknowledge or fyi and was not.");
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:NotificationWorkflowDocumentServiceImpl.java


示例13: testRecallAsInitiatorBeforeAnyApprovals

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
@Test public void testRecallAsInitiatorBeforeAnyApprovals() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(EWESTFAL, RECALL_TEST_DOC);
    document.route("");

    document.recall("recalling", true);

    assertTrue("Document should be recalled", document.isRecalled());
    assertAfterActionTakenCalled(ActionType.RECALL, ActionType.RECALL);

    //verify that the document is truly dead - no more action requests or action items.

    List requests = KEWServiceLocator.getActionRequestService().findPendingByDoc(document.getDocumentId());
    assertEquals("Should not have any active requests", 0, requests.size());

    Collection<ActionItem> actionItems = KEWServiceLocator.getActionListService().findByDocumentId(document.getDocumentId());
    assertEquals("Should not have any action items", 0, actionItems.size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:RecallActionTest.java


示例14: testGroup

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * This method specifically exercises a group responsibility to assure that the 
 * {@link StyleableEmailContentServiceImpl} can handle that case.
 * See KULRICE-3659.
 */
@Test
public void testGroup() throws Exception {
	String ewestfalPrincipalId = getPrincipalIdForName("ewestfal");
	
	// this document type has a group responsibility
	WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "EmailTestWorkgroupDocType");
	doc.route("");
	
	ActionListFilter actionListFilter = new ActionListFilter();
	actionListFilter.setDocumentType(doc.getDocumentTypeName());
	Collection<ActionItem> actionItems = KEWServiceLocator.getActionListService().getActionList(ewestfalPrincipalId, actionListFilter);

	EmailContentService emailContentService = KEWServiceLocator.getEmailContentService();
	
	Person person = KimApiServiceLocator.getPersonService().getPerson(ewestfalPrincipalId);
	// this would blow up before the fix
	EmailContent emailContent = emailContentService.generateDailyReminder(person, ActionItem.to(new ArrayList<ActionItem>(actionItems)));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:EmailContentServiceTest.java


示例15: testExceptionInTransitionFromStart

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * this tests that the document appropriately gets to exception routing if there is a
 * problem when transitioning out of first node
 *
 * @throws Exception
 */
@Test public void testExceptionInTransitionFromStart() throws Exception {

	WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "AdhocTransitionTestDocument");
	//blow chunks transitioning out of adhoc to the first route node
	ExceptionRoutingTestPostProcessor.THROW_ROUTE_STATUS_LEVEL_EXCEPTION = true;

	try {
		doc.route("");
		fail("We should be in exception routing");
	} catch (Exception e) {
	}

	TestUtilities.getExceptionThreader().join();//this is necessary to ensure that the exception request will be generated.
	doc = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), doc.getDocumentId());
	assertEquals("document should be in exception routing", DocumentStatus.EXCEPTION, doc.getStatus());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:ExceptionRoutingTest.java


示例16: testGetWebFriendlyRecipientsWithGroup

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * KULRICE-7615
 * bmcgough is a secondary delegate *for* the NonSIT group; getWebFriendlyRecipients should handle this
 */
@Test
public void testGetWebFriendlyRecipientsWithGroup() {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("jhopf"), "ActionListDocumentType_PrimaryDelegate");
    document.route("");
    Person bmcgough = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("bmcgough");
    Collection<Recipient> delegators = getActionListService().findUserSecondaryDelegators(bmcgough.getPrincipalId());
    String nonSITGroupId = getGroupIdForName("KR-WKFLW", "NonSIT");
    assertFalse(delegators.isEmpty());
    boolean nonSITGroupFound = false;
    for (Recipient d: delegators) {
        if (d instanceof KimGroupRecipient) {
            if (nonSITGroupId.equals(((KimGroupRecipient) d).getGroupId())) {
                nonSITGroupFound = true;
            }
        }
    }
    assertTrue("NonSIT group was not found as a delegator to bmcgough (has test config changed?)", nonSITGroupFound);
    // now test that it can actually deal with the KimGroupRecipient
    ActionListUtil.getWebFriendlyRecipients(delegators);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:ActionListTest.java


示例17: superUserDisapprove

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
protected void superUserDisapprove(boolean notify) throws Exception {
       WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), notify ? DOC_TYPE_WITH_NOTIFY: DOC_TYPE);
       document.route("");

       WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId()).approve("");
       WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId()).approve("");
       WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId()).approve("");

       document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId());
       assertTrue("WorkflowDocument should indicate jhopf as SuperUser", document.isValidAction(ActionType.SU_DISAPPROVE));
       document.superUserDisapprove("");
       assertTrue("Document should be final after Super User Disapprove", document.isDisapproved());
       if (notify) {
           assertTrue(WorkflowDocumentFactory.loadDocument(document.getInitiatorPrincipalId(), document.getDocumentId()).isAcknowledgeRequested());
           assertTrue(WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId()).isAcknowledgeRequested());
           assertTrue(WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId()).isAcknowledgeRequested());
           // jhopf took the super user action so should not be notified of disapproval (see KULRICE-752)
           assertFalse(WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId()).isAcknowledgeRequested());
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:SuperUserDisapproveTest.java


示例18: testKimExceptionRouting

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * Checks to make sure that the KIM routing is working.
 * Based upon the test method org.kuali.rice.kew.doctype.DocumentTypeTest.testFinalApproverRouting()
 */
@Test public void testKimExceptionRouting() throws Exception {
	loadXmlFile("RouteExceptionTestDoc.xml");
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("admin"), "TestFinalApproverDocumentType");
       document.setTitle("");
       document.route("");
       document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
       try {
           document.approve("");
           fail("document should have thrown routing exception");
       } catch (Exception e) {
           //deal with single transaction issue in test.
       	TestUtilities.getExceptionThreader().join();
       	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
           assertTrue("Document should be in exception routing", document.isException());
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:ExceptionRoutingServiceTest.java


示例19: testRouteDocumentWithMalformedSearchableAttributeContent

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * Tests searching with client-generated documentContent which is just malformed XML.
 * @throws WorkflowException
 */
@Test public void testRouteDocumentWithMalformedSearchableAttributeContent() throws WorkflowException {
    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "SearchDocType");

    workflowDocument.setApplicationContent("hey, <I'm Not ] Even & XML");

    workflowDocument.setTitle("Routing style");
    try {
        workflowDocument.route("routing this document.");
        fail("routeDocument succeeded with malformed XML");
    } catch (Exception we) {
        // An exception is thrown in DTOConverter/XmlUtils.appendXml at the time of this writing
        // so I will just assume that is the expected behavior
    }
    TestUtilities.waitForExceptionRouting();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:StandardGenericXMLSearchableAttributeTest.java


示例20: setupPerformDocumentSearchTests

import org.kuali.rice.kew.api.WorkflowDocument; //导入依赖的package包/类
/**
 * This method routes two test documents of the type specified.  One has the given title and another has a dummy title.
 */
private void setupPerformDocumentSearchTests(String documentTypeName, String expectedRouteNodeName, String docTitle) throws WorkflowException {
    String userNetworkId = "ewestfal";
    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
    workflowDocument.setTitle("Respect my Authoritah");
    workflowDocument.route("routing this document.");
    if (StringUtils.isNotBlank(expectedRouteNodeName)) {
    	assertEquals("Document is not at expected routeNodeName", expectedRouteNodeName, workflowDocument.getNodeNames().iterator().next());
    }

    userNetworkId = "rkirkend";
    workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
    workflowDocument.setTitle(docTitle);
    workflowDocument.route("routing this document.");
    if (StringUtils.isNotBlank(expectedRouteNodeName)) {
    	assertEquals("Document is not at expected routeNodeName", expectedRouteNodeName, workflowDocument.getNodeNames().iterator().next());
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:WorkflowUtilityTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PropertyIsLike类代码示例发布时间:1970-01-01
下一篇:
Java Utils类代码示例发布时间:1970-01-01
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap