本文整理汇总了Java中org.kuali.rice.kew.engine.node.Branch.getBranchState方法的典型用法代码示例。如果您正苦于以下问题:Java Branch.getBranchState方法的具体用法?Java Branch.getBranchState怎么用?Java Branch.getBranchState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.engine.node.Branch
的用法示例。
在下文中一共展示了Branch.getBranchState方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVariables
import org.kuali.rice.kew.engine.node.Branch; //导入方法依赖的package包/类
@Override
public Map<String, String> getVariables() {
Map<String, String> documentVariables = new HashMap<String, String>();
/* populate the routeHeaderVO with the document variables */
// FIXME: we assume there is only one for now
Branch routeNodeInstanceBranch = getRootBranch();
// Ok, we are using the "branch state" as the arbitrary convenient repository for flow/process/edoc variables
// so we need to stuff them into the VO
if (routeNodeInstanceBranch != null) {
List<BranchState> listOfBranchStates = routeNodeInstanceBranch.getBranchState();
for (BranchState bs : listOfBranchStates) {
if (bs.getKey() != null && bs.getKey().startsWith(BranchState.VARIABLE_PREFIX)) {
if ( LOG.isDebugEnabled() ) {
if ( LOG.isDebugEnabled() ) {
LOG.debug("Setting branch state variable on vo: " + bs.getKey() + "=" + bs.getValue());
}
}
documentVariables.put(bs.getKey().substring(BranchState.VARIABLE_PREFIX.length()), bs.getValue());
}
}
}
return documentVariables;
}
示例2: testSystemBranchState
import org.kuali.rice.kew.engine.node.Branch; //导入方法依赖的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: getVariables
import org.kuali.rice.kew.engine.node.Branch; //导入方法依赖的package包/类
@Override
public Map<String, String> getVariables() {
Map<String, String> documentVariables = new HashMap<String, String>();
/* populate the routeHeaderVO with the document variables */
// FIXME: we assume there is only one for now
Branch routeNodeInstanceBranch = getRootBranch();
// Ok, we are using the "branch state" as the arbitrary convenient repository for flow/process/edoc variables
// so we need to stuff them into the VO
if (routeNodeInstanceBranch != null) {
List<BranchState> listOfBranchStates = routeNodeInstanceBranch.getBranchState();
for (BranchState bs : listOfBranchStates) {
if (bs.getKey() != null && bs.getKey().startsWith(BranchState.VARIABLE_PREFIX)) {
LOG.debug("Setting branch state variable on vo: " + bs.getKey() + "=" + bs.getValue());
documentVariables.put(bs.getKey().substring(BranchState.VARIABLE_PREFIX.length()), bs.getValue());
}
}
}
return documentVariables;
}
示例4: getRevokedNodeInstances
import org.kuali.rice.kew.engine.node.Branch; //导入方法依赖的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;
}
示例5: findVariable
import org.kuali.rice.kew.engine.node.Branch; //导入方法依赖的package包/类
/**
* Looks up a variable (embodied in a "BranchState" key/value pair) in the
* branch state table.
*/
private BranchState findVariable(String name) {
Branch rootBranch = getRootBranch();
if (rootBranch != null) {
List<BranchState> branchState = rootBranch.getBranchState();
Iterator<BranchState> it = branchState.iterator();
while (it.hasNext()) {
BranchState state = it.next();
if (ObjectUtils.equals(state.getKey(), BranchState.VARIABLE_PREFIX + name)) {
return state;
}
}
}
return null;
}
示例6: getRevokedNodeInstances
import org.kuali.rice.kew.engine.node.Branch; //导入方法依赖的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;
}
示例7: dumpBranch
import org.kuali.rice.kew.engine.node.Branch; //导入方法依赖的package包/类
public void dumpBranch(Branch b) {
LOG.info("Branch: " + b.getBranchId() + " " + b.getName());
for (BranchState bs: b.getBranchState()) {
LOG.info(bs.getBranchStateId() + " " + bs.getKey() + " " + bs.getValue());
}
}