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


Java WorkflowDocument.saveDocumentData方法代码示例

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


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

示例1: routeTestDocs

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Routes some test docs for searching
 * @return String[] of doc ids
 */
protected String[] routeTestDocs() {
    // Route some test documents.
    String[] docIds = new String[TestDocData.titles.length];

    for (int i = 0; i < TestDocData.titles.length; i++) {
        WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(
                getPrincipalId(TestDocData.principalNames[i]), TestDocData.docTypeName);
        workflowDocument.setTitle(TestDocData.titles[i]);
        workflowDocument.setApplicationDocumentId(TestDocData.appDocIds[i]);
        workflowDocument.route("routing this document.");

        docIds[i] = workflowDocument.getDocumentId();

        if (TestDocData.approverNames[i] != null) {
            workflowDocument.switchPrincipal(getPrincipalId(TestDocData.approverNames[i]));
            workflowDocument.approve("approving this document.");
        }

        workflowDocument.setApplicationDocumentStatus(TestDocData.appDocStatuses[i]);
        workflowDocument.saveDocumentData();
    }

    return docIds;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:DocumentSearchTest.java

示例2: testGetAppDocStatus

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test
public void testGetAppDocStatus() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"),
            "TestDocumentType");
    document.saveDocumentData();

    String appDocStatus = KewApiServiceLocator.getWorkflowDocumentService().getApplicationDocumentStatus(document.getDocumentId());
    assertNull("appDocStatus should be null", appDocStatus);

    String appDocStatusValue = "Approved";
    document.setApplicationDocumentStatus(appDocStatusValue);
    document.saveDocumentData();

    appDocStatus = KewApiServiceLocator.getWorkflowDocumentService().getApplicationDocumentStatus(document.getDocumentId());
    assertEquals("Incorrect appDocStatus", appDocStatusValue, appDocStatus);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:WorkflowInfoTest.java

示例3: testManualDocumentContentModification

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests modification of the DocumentContentVO object directly.
 */
@Test public void testManualDocumentContentModification() throws Exception {
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TestDocumentType");
	document.saveDocumentData();
	
	// fetch it from WorkflowInfo
	DocumentContent content = KewApiServiceLocator.getWorkflowDocumentService().getDocumentContent(document.getDocumentId());
	assertTrue("Should contain default content, was " + content.getFullContent(), KewApiConstants.DEFAULT_DOCUMENT_CONTENT.equals(content.getFullContent()) ||
			KewApiConstants.DEFAULT_DOCUMENT_CONTENT2.equals(content.getFullContent()));
	
	String appContent = "<abcdefg>hijklm n o p</abcdefg>";
	DocumentContentUpdate.Builder contentUpdate = DocumentContentUpdate.Builder.create(content);
	contentUpdate.setApplicationContent(appContent);
	document.updateDocumentContent(contentUpdate.build());
    document.saveDocumentData();
	
	// test that the content on the document is the same as the content we just set
	XMLAssert.assertXMLEqual(appContent, document.getApplicationContent());
	
	// fetch the document fresh and make sure the content is correct
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
	XMLAssert.assertXMLEqual(appContent, document.getApplicationContent());
	
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:DocumentContentTest.java

示例4: testValidInheritedAppDocStatus

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 *
 * This method is similar to the above test, except that the doctype definition
 * INHERITS a valid set of application document status values.
 *
 * @throws Exception
 */
@Test public void testValidInheritedAppDocStatus() throws Exception {
    // Create document
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TestAppDocStatusDoc3");
    document.saveDocumentData();
    assertNotNull(document.getDocumentId());
    assertTrue("Document should be initiatied", document.isInitiated());
    assertTrue("Invalid route level.", document.getNodeNames().contains("Initiated"));
    DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByName("TestAppDocStatusDoc3");
    assertTrue(KRADUtils.isNotNull(documentType));
    assertTrue(KRADUtils.isNotNull(documentType.getValidApplicationStatuses()));
    assertEquals(6,documentType.getValidApplicationStatuses().size());
    LOG.info("valid application status size: " + documentType.getValidApplicationStatuses().size());
    assertTrue(KRADUtils.isNotNull(documentType.getApplicationStatusCategories()));
    assertEquals(0,documentType.getApplicationStatusCategories().size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:AppDocStatusTest.java

示例5: testValidInheritedAppDocStatusWithCategories

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 *
 * This method an inherited valid set of values and categories.
 *
 * @throws Exception
 */
@Test public void testValidInheritedAppDocStatusWithCategories() throws Exception {
    // Create document
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TestAppDocStatusDoc5");
    document.saveDocumentData();
    assertNotNull(document.getDocumentId());
    assertTrue("Document should be initiatied", document.isInitiated());
    assertTrue("Invalid route level.", document.getNodeNames().contains("Initiated"));
    DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByName("TestAppDocStatusDoc5");
    assertTrue(KRADUtils.isNotNull(documentType));
    assertTrue(KRADUtils.isNotNull(documentType.getValidApplicationStatuses()));
    LOG.info("valid application status size: " + documentType.getValidApplicationStatuses().size());
    assertEquals(6,documentType.getValidApplicationStatuses().size());
    assertTrue(KRADUtils.isNotNull(documentType.getApplicationStatusCategories()));
    assertEquals(2,documentType.getApplicationStatusCategories().size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:AppDocStatusTest.java

示例6: testInheritedAppDocStatusWithKEWStatus

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 *
 * This method tests a valid set of application document status values that are not inherited due to KEW status (KULRICE-8943).
 *
 * @throws Exception
 */
@Test public void testInheritedAppDocStatusWithKEWStatus() throws Exception {
    // Create document
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TestAppDocStatusDoc6");
    document.saveDocumentData();
    assertNotNull(document.getDocumentId());
    assertTrue("Document should be initiatied", document.isInitiated());
    assertTrue("Invalid route level.", document.getNodeNames().contains("Initiated"));
    DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByName("TestAppDocStatusDoc6");
    assertTrue(KRADUtils.isNotNull(documentType));
    assertTrue(KRADUtils.isNotNull(documentType.getValidApplicationStatuses()));
    assertEquals(0,documentType.getValidApplicationStatuses().size());
    LOG.info("valid application status size: " + documentType.getValidApplicationStatuses().size());
    assertTrue(KRADUtils.isNotNull(documentType.getApplicationStatusCategories()));
    assertEquals(0,documentType.getApplicationStatusCategories().size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:AppDocStatusTest.java

示例7: testGetAppDocId

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test
public void testGetAppDocId() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"),
            "TestDocumentType");
    document.saveDocumentData();

    String appDocId = KewApiServiceLocator.getWorkflowDocumentService().getApplicationDocumentId(document.getDocumentId());
    assertNull("appDocId should be null", appDocId);

    String appDocIdValue = "1234";
    document.setApplicationDocumentId(appDocIdValue);
    document.saveDocumentData();

    appDocId = KewApiServiceLocator.getWorkflowDocumentService().getApplicationDocumentId(document.getDocumentId());
    assertEquals("Incorrect appDocId", appDocIdValue, appDocId);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:WorkflowInfoTest.java

示例8: testAdHocWhenDocumentIsInitiated

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testAdHocWhenDocumentIsInitiated() throws Exception {
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TakeWorkgroupAuthorityDoc");
    document.saveDocumentData();
    assertTrue(document.isInitiated());

    document.adHocToPrincipal(ActionRequestType.APPROVE, "My Annotation", getPrincipalIdForName("rkirkend"), "", true);
    document.adHocToPrincipal(ActionRequestType.FYI, "My Annotation", getPrincipalIdForName("user1"), "", true);

    // this is an initiated document, the requests should not be activated yet
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertFalse(document.isApprovalRequested());
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user1"), document.getDocumentId());
    assertFalse(document.isFYIRequested());

    // now route the document, the requests should be activated
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
    document.route("");
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertTrue(document.isApprovalRequested());
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("user1"), document.getDocumentId());
    assertTrue(document.isFYIRequested());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:AdHocRouteTest.java

示例9: testFalseInitiatorMustSavePolicy

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests for when INITIATOR_MUST_SAVE policy is equal to false.  In this case if non-initiator user
 * attempts a save of a document with this policy an exception should NOT be thrown
 */
@Test public void testFalseInitiatorMustSavePolicy() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), DOCUMENT_TYPE_NAME_NON_INITIATOR);
    document.saveDocumentData();
    
    // verify that there are no requests that have been generated
    List actionRequests = KEWServiceLocator.getActionRequestService().findAllActionRequestsByDocumentId(document.getDocumentId());
    assertEquals("There should be no action requests.", 0, actionRequests.size());
    
    // try saving as a user who's not ewestfal
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertTrue(document.isInitiated());
    document.saveDocument("");
    
    // ensure that the document was saved and the request was generated
    assertTrue(document.isSaved());
    actionRequests = KEWServiceLocator.getActionRequestService().findAllActionRequestsByDocumentId(document.getDocumentId());
    assertEquals("There should be one action request.", 1, actionRequests.size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:SaveActionEventTest.java

示例10: testDocumentContentConsistency

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests that document content is reloaded from the database after every call (such as Approve, etc.)
 * so as to verify that the document content stored on the WorkflowDocument will not go stale in between
 * calls.
 */
@Test public void testDocumentContentConsistency() throws Exception {
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TestDocumentType");
	String appContent = "<app>content</app>";
	document.setApplicationContent(appContent);
	document.saveDocumentData();
    XMLAssert.assertXMLEqual(appContent, document.getApplicationContent());
	
	// load the document and modify the content
	WorkflowDocument document2 = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
	XMLAssert.assertXMLEqual(appContent, document2.getApplicationContent());
	String appContent2 = "<app>content2</app>";
	document2.setApplicationContent(appContent2);
	XMLAssert.assertXMLEqual(appContent2, document2.getApplicationContent());
	document2.saveDocumentData();
	
	// the original document should not notice these changes yet
	XMLAssert.assertXMLEqual(appContent, document.getApplicationContent());
	// but if we saveRoutingData, we should see the new value
	document.saveDocumentData();
	XMLAssert.assertXMLEqual(appContent2, document.getApplicationContent());
	
	// also verify that just setting the content, but not saving it, doesn't get persisted
	document2.setApplicationContent("<bad>content</bad>");
	document2 = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document2.getDocumentId());
	XMLAssert.assertXMLEqual(appContent2, document.getApplicationContent());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:DocumentContentTest.java

示例11: doRouteStatusChange

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Override
public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {
	WorkflowDocument doc = WorkflowDocumentFactory.loadDocument(KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("rkirkend").getPrincipalId(), statusChangeEvent.getDocumentId());
	doc.setTitle("I'm a title - I should increment the lockVersion Number of this document");
	doc.saveDocumentData();
	return new ProcessDocReport(true);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:StandardGenericXMLSearchableAttributePostProcessor.java

示例12: testSpawnDocument

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testSpawnDocument() throws Exception {
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("jitrue"), DOCUMENT_TYPE_THAT_SPAWNS);
	document.saveDocumentData();
	assertNotNull(document.getDocumentId());
	assertTrue("Document should be initiatied", document.isInitiated());
	document.route("Route");

    // should have generated a request to "bmcgough"
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
    assertTrue("Document should be enroute", document.isEnroute());
    assertEquals("Document should be enroute.", KewApiConstants.ROUTE_HEADER_ENROUTE_CD, document.getStatus().getCode());
    assertTrue(document.isApprovalRequested());
    document.approve("Test approve by bmcgough");
    
    String originalDocumentId = document.getDocumentId();
	Long originalDocumentIdLong = Long.parseLong(originalDocumentId.trim());
    Long spawnedDocumentIdLong = (originalDocumentIdLong + 1);
    String spawnedDocumentId = spawnedDocumentIdLong.toString();
    
	// get spawned document (should be next document id)
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), spawnedDocumentId);
    assertEquals("Document should be final.", KewApiConstants.ROUTE_HEADER_FINAL_CD, document.getStatus().getCode());

	// get original document
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), originalDocumentId);
    assertEquals("Document should be final.", KewApiConstants.ROUTE_HEADER_FINAL_CD, document.getStatus().getCode());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:PostProcessorSpawnedDocumentTest.java

示例13: testDynamicParallelRoute

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testDynamicParallelRoute() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), SEQ_DOC_TYPE_NAME);
    document.saveDocumentData();
    assertTrue("Document should be initiated", document.isInitiated());
    assertEquals("Should be no action requests.", 0, document.getRootActionRequests().size());
    List<RouteNodeInstance> nodeInstances = KEWServiceLocator.getRouteNodeService().getActiveNodeInstances(document.getDocumentId());
    assertEquals("Wrong number of active nodes.", 1, nodeInstances.size());
    assertEquals("Wrong active node.", INIT, nodeInstances.iterator().next().getRouteNode().getRouteNodeName());
    document.route("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
    assertTrue("Approve should be requested.", document.isApprovalRequested());
    document.approve("");

    nodeInstances = KEWServiceLocator.getRouteNodeService().getActiveNodeInstances(document.getDocumentId());
    assertEquals("Wrong number of active nodes.", 1, nodeInstances.size());
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("pmckown"), document.getDocumentId());
    assertTrue("Approve should be requested.", document.isApprovalRequested());
    document.approve("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("temay"), document.getDocumentId());
    assertTrue("Approve should be requested.", document.isApprovalRequested());
    document.approve("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("jhopf"), document.getDocumentId());
    assertTrue("Approve should be requested.", document.isApprovalRequested());
    document.approve("");

    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertTrue("Approve should be requested.", document.isApprovalRequested());
    document.approve("");

    //        document = WorkflowDocumentFactory.loadDocument(new NetworkIdVO("ewestfal"), document.getDocumentId());
    //        assertTrue("Document should be final.", document.isFinal());

    verifyRoutingPath(document.getDocumentId());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:38,代码来源:DynamicRoutingTest.java

示例14: testEmptyParallelBranches

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Tests that the document route past the join properly when there are parallel branches that don't generate requests.
 * This was coded in response to a bug found while testing with ERA in order to track it down and fix it.
 */
@Test public void testEmptyParallelBranches() throws Exception {
    
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), PARALLEL_EMPTY_DOCUMENT_TYPE_NAME);
    document.saveDocumentData();
    assertTrue("Document should be initiated", document.isInitiated());
    assertEquals("Should be no action requests.", 0, document.getRootActionRequests().size());
    Collection<? extends Object> nodeInstances = KEWServiceLocator.getRouteNodeService().getActiveNodeInstances(document.getDocumentId());
    assertEquals("Wrong number of active nodes.", 1, nodeInstances.size());
    document.route("");
    
    // should have generated a request to "bmcgough"
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
    assertTrue("Document should be enroute", document.isEnroute());
    List<ActionRequestValue> actionRequests = KEWServiceLocator.getActionRequestService().findPendingByDoc(document.getDocumentId());
    assertEquals("Incorrect pending action requests.", 1, actionRequests.size());
    ActionRequestValue bRequest = actionRequests.get(0);
    assertNotNull("Should have been routed through node instance.", bRequest.getNodeInstance());
    assertTrue(document.isApprovalRequested());
    
    document.approve("");
    
    // now the document should have split, passed through nodes in each branch which didn't generate requests,
    // and then passed the join node and generated requests at WorkflowDocumentFinal
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("xqi"), document.getDocumentId());
    assertTrue("Document should be enroute", document.isEnroute());
    assertTrue(document.isApprovalRequested());
    
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:ParallelRoutingTest.java

示例15: testFutureRequestsWithDuplicateNodesImpl

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
private void testFutureRequestsWithDuplicateNodesImpl(String fileName) throws Exception{    	
	this.loadXmlFile(this.getClass(), fileName);
	

    String user1PrincipalId = getPrincipalIdForName("user1");
    String user2PrincipalId = getPrincipalIdForName("user2");
    String user3PrincipalId = getPrincipalIdForName("earl");

    WorkflowDocument document = WorkflowDocumentFactory.createDocument(user1PrincipalId, "FutureRequestsDoc");
    document.route("");
   

    // Node1
    //user1 should have approval requested
    document = WorkflowDocumentFactory.loadDocument(user3PrincipalId, document.getDocumentId());
    assertTrue("should have approval status", document.isApprovalRequested());

    document.setReceiveFutureRequests();
    
    /*
     *  Uncomment the following line to duplicate the error in KC
     */        
    document.saveDocumentData();
    
    document.approve("route node 1");

    document =WorkflowDocumentFactory.loadDocument(user1PrincipalId, document.getDocumentId());
    assertFalse("should not have approval status 1", document.isApprovalRequested());

    document = WorkflowDocumentFactory.loadDocument(user2PrincipalId, document.getDocumentId());
    assertTrue("should have approval status 2", document.isApprovalRequested());
    document.approve("routing node 2");
    
    // Node3
    //user1 should have approval requested bc of future action requests
    document = WorkflowDocumentFactory.loadDocument(user3PrincipalId, document.getDocumentId());
    assertTrue("should have approval status 3", document.isApprovalRequested());
    document.approve("routing node 3");

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:41,代码来源:FutureRequestsTest.java


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