1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.rule;
17
18 import java.sql.Timestamp;
19 import java.util.Map;
20
21 import org.apache.log4j.Logger;
22 import org.kuali.rice.kew.engine.RouteContext;
23 import org.kuali.rice.kew.engine.node.RouteNodeInstance;
24 import org.kuali.rice.kew.engine.node.hierarchyrouting.HierarchyRoutingNode;
25 import org.kuali.rice.kew.exception.WorkflowException;
26 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
27 import org.kuali.rice.kew.util.Utilities;
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 public class HierarchicalNamedRuleSelector extends NamedRuleSelector {
45 private static final Logger LOG = Logger.getLogger(HierarchicalNamedRuleSelector.class);
46 @Override
47 protected String getName(RouteContext context, DocumentRouteHeaderValue routeHeader, RouteNodeInstance nodeInstance,
48 String selectionCriterion, Timestamp effectiveDate) throws WorkflowException {
49 Map<String, String> cfgMap = Utilities.getKeyValueCollectionAsMap(nodeInstance.getState());
50 String stop_id = cfgMap.get(HierarchyRoutingNode.STOP_ID);
51 if (stop_id == null) {
52 LOG.error("STOP ID from nodeInstance was NULL: " + nodeInstance);
53 return null;
54 }
55 LOG.error("STOP ID from nodeInstance: " + nodeInstance.getRouteNodeInstanceId() + ": " + stop_id);
56 return nodeInstance.getProcess().getRouteNode().getRouteNodeName() + "-" + stop_id;
57 }
58 }