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