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


Java DocumentRouteHeaderValue.getRootBranch方法代码示例

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


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

示例1: FutureRequestDocumentStateManager

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
public FutureRequestDocumentStateManager (DocumentRouteHeaderValue document, String principalId)
{
    if (document.getRootBranch() != null) {
    	for (BranchState state : document.getRootBranchState()) {
    	    if (isStateForUser(state, principalId)) {
        		if (isReceiveFutureRequests(state)) {
        		    this.receiveFutureRequests = true;
        		} else if (isDoNotReceiveFutureRequests(state)) {
        		    this.doNotReceiveFutureRequests = true;
        		} else if (isClearFutureRequests(state)) {
        		    this.clearFutureRequestState = true;
        		    this.receiveFutureRequests = false;
        		    this.doNotReceiveFutureRequests = false;
        		    break;
        		}
    	    }
    	}
    }
	if (this.isClearFutureRequestState()) {
	    this.clearStateFromDocument(document);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:FutureRequestDocumentStateManager.java

示例2: testSystemBranchState

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
/**
 * Tests that the proper state is set up on the root branch in the document
 * to indicate that both PROCESSED and FINAL callbacks have been made into
 * the post processor.
 */
@Test public void testSystemBranchState() throws Exception {
	// route the document to final
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "SimpleDocType");
	document.route("");
	assertTrue("Document should be final.", document.isFinal());

	// now look at the branch state
	DocumentRouteHeaderValue routeHeader = KEWServiceLocator.getRouteHeaderService().getRouteHeader(document.getDocumentId());
	Branch rootBranch = routeHeader.getRootBranch();
	assertNotNull(rootBranch);
	BranchState processedBranchState = rootBranch.getBranchState(KewApiConstants.POST_PROCESSOR_PROCESSED_KEY);
	BranchState finalBranchState = rootBranch.getBranchState(KewApiConstants.POST_PROCESSOR_FINAL_KEY);
	assertNotNull(processedBranchState);
	assertNotNull(finalBranchState);
	assertEquals("true", processedBranchState.getValue());
	assertEquals("true", finalBranchState.getValue());
	assertEquals(1, TestPostProcessor.processedCount);
	assertEquals(1, TestPostProcessor.finalCount);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:StandardWorkflowEngineTest.java

示例3: getRevokedNodeInstances

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
/**
    * Queries the list of revoked node instances from the root BranchState of the Document
    * and returns a List of revoked RouteNodeInstances.
    */
public List getRevokedNodeInstances(DocumentRouteHeaderValue document) {
	if (document == null) {
   		throw new IllegalArgumentException("Document must not be null.");
   	}
	List<RouteNodeInstance> revokedNodeInstances = new ArrayList<RouteNodeInstance>();

   	Branch rootBranch = document.getRootBranch();
   	BranchState state = null;
   	if (rootBranch != null) {
   	    state = rootBranch.getBranchState(REVOKED_NODE_INSTANCES_STATE_KEY);
   	}
   	if (state == null || org.apache.commons.lang.StringUtils.isEmpty(state.getValue())) {
   		return revokedNodeInstances;
   	}
   	String[] revokedNodes = state.getValue().split(",");
   	for (int index = 0; index < revokedNodes.length; index++) {
		String revokedNodeInstanceId = revokedNodes[index];
		RouteNodeInstance revokedNodeInstance = findRouteNodeInstanceById(revokedNodeInstanceId);
		if (revokedNodeInstance == null) {
			LOG.warn("Could not locate revoked RouteNodeInstance with the given id: " + revokedNodeInstanceId);
		} else {
			revokedNodeInstances.add(revokedNodeInstance);
		}
	}
   	return revokedNodeInstances;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:RouteNodeServiceImpl.java


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