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


Java KewApiServiceLocator.getWorkflowDocumentService方法代码示例

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


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

示例1: testGetSearchableAttributeDateTimeValuesByKey

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的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

示例2: getAdHocRouteNodeName

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
protected String getAdHocRouteNodeName(String documentId) throws WorkflowException {
    WorkflowDocumentService workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
    List<RouteNodeInstance> nodeInstances = workflowDocumentService.getActiveRouteNodeInstances(documentId);
    if (nodeInstances == null || nodeInstances.isEmpty()) {
        nodeInstances = workflowDocumentService.getTerminalRouteNodeInstances(documentId);
    }
    if (nodeInstances == null || nodeInstances.isEmpty()) {
        throw new WorkflowException("Could not locate a node on the document to send the ad hoc request to.");
    }
    return nodeInstances.get(0).getName();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:SuperUserAction.java

示例3: testMoveDocumentInsideProcess

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
/**
 * This tests that we can invoke the move document command inside of a sub process.
 */
@Test public void testMoveDocumentInsideProcess() throws Exception {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("user1"), "MoveInProcessTest");
    document.route("");
    
    // approve as bmcgough and rkirkend to move into process
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
    assertTrue("bmcgough should have approve", document.isApprovalRequested());
    document.approve("");
    document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
    assertTrue("rkirkend should have approve", document.isApprovalRequested());
    document.approve("");

    WorkflowDocumentService workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
    List<RouteNodeInstance> activeNodeInstances = workflowDocumentService.getActiveRouteNodeInstances(document.getDocumentId());
    assertEquals("Should be 1 active node instance.", 1, activeNodeInstances.size());
    RouteNodeInstance node2 = activeNodeInstances.get(0);
    assertEquals("Should be at the WorkflowDocument2 node.", SeqSetup.WORKFLOW_DOCUMENT_2_NODE, node2.getName());
    assertTrue("Node should be in a process.", node2.getProcessId() != null);
    
    // now try to move the document forward one which will keep us inside the subprocess
    document.move(MovePoint.create(SeqSetup.WORKFLOW_DOCUMENT_2_NODE, 1), "");
    
    activeNodeInstances = workflowDocumentService.getActiveRouteNodeInstances(document.getDocumentId());
    RouteNodeInstance node3 = activeNodeInstances.get(0);
    assertEquals("Should be at the WorkflowDocument3 node.", SeqSetup.WORKFLOW_DOCUMENT_3_NODE, node3.getName());
    assertTrue("Node should be in a process.", node3.getProcessId() != null);
    assertEquals("Node 2 and 3 should be in the same process.", node2.getProcessId(), node3.getProcessId());
    
    document.move(MovePoint.create(SeqSetup.WORKFLOW_DOCUMENT_3_NODE, 0), "");
    
    document.move(MovePoint.create(SeqSetup.WORKFLOW_DOCUMENT_3_NODE, -1), "");
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:36,代码来源:MoveDocumentTest.java

示例4: hasDerivedRole

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
@Override
public boolean hasDerivedRole(
		String principalId, List<String> groupIds, String namespaceCode, String roleName, Map<String, String> qualification){
	if (StringUtils.isBlank(principalId)) {
           throw new RiceIllegalArgumentException("principalId was null or blank");
       }

       if (groupIds == null) {
           throw new RiceIllegalArgumentException("groupIds was null or blank");
       }

       if (StringUtils.isBlank(namespaceCode)) {
           throw new RiceIllegalArgumentException("namespaceCode was null or blank");
       }

       if (StringUtils.isBlank(roleName)) {
           throw new RiceIllegalArgumentException("roleName was null or blank");
       }

       if (qualification == null) {
           throw new RiceIllegalArgumentException("qualification was null");
       }


       validateRequiredAttributesAgainstReceived(qualification);
       boolean isUserInRouteLog = false;
	if(qualification!=null && !qualification.isEmpty()){
		String documentId = qualification.get(KimConstants.AttributeConstants.DOCUMENT_NUMBER);
           WorkflowDocumentService workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
		try {
			if (INITIATOR_ROLE_NAME.equals(roleName)){
				isUserInRouteLog = principalId.equals(workflowDocumentService.getDocumentInitiatorPrincipalId(documentId));
			} else if(INITIATOR_OR_REVIEWER_ROLE_NAME.equals(roleName)){
				isUserInRouteLog = KewApiServiceLocator.getWorkflowDocumentActionsService().isUserInRouteLog(
                           documentId, principalId, true);
			} else if(ROUTER_ROLE_NAME.equals(roleName)){
				isUserInRouteLog = principalId.equals(workflowDocumentService.getRoutedByPrincipalIdByDocumentId(
                           documentId));
			}
		} catch (Exception wex) {
			throw new RuntimeException("Error in determining whether the principal Id: " + principalId + " is in route log " +
					"for document id: " + documentId + " :"+wex.getLocalizedMessage(),wex);
		}
	}
	return isUserInRouteLog;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:47,代码来源:RouteLogDerivedRoleTypeServiceImpl.java

示例5: getWorkflowDocumentService

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
public WorkflowDocumentService getWorkflowDocumentService() {
    if (workflowDocumentService == null) {
        workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
    }
    return workflowDocumentService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:WorkflowDocumentImpl.java

示例6: getWorkflowDocumentService

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
protected WorkflowDocumentService getWorkflowDocumentService() {
    return KewApiServiceLocator.getWorkflowDocumentService();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:DocumentAttributeIndexingQueueImpl.java

示例7: setUpAfterDataLoad

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
@Override
protected void setUpAfterDataLoad() throws Exception {
	super.setUpAfterDataLoad();
	this.service = KewApiServiceLocator.getWorkflowDocumentService();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:DocumentLinkTest.java

示例8: setUpService

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
@Before
public void setUpService() {
    this.workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:WorkflowDocumentServiceImplTest.java


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