1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.kuali.rice.kew.engine.node.var.schemes;
19
20 import org.apache.log4j.Logger;
21 import org.kuali.rice.kew.engine.RouteContext;
22 import org.kuali.rice.kew.engine.node.BranchState;
23 import org.kuali.rice.kew.engine.node.service.BranchService;
24 import org.kuali.rice.kew.engine.node.var.Property;
25 import org.kuali.rice.kew.engine.node.var.PropertyScheme;
26 import org.kuali.rice.kew.service.KEWServiceLocator;
27
28
29
30
31
32
33
34 public final class VariableScheme implements PropertyScheme {
35 private static final Logger LOG = Logger.getLogger(VariableScheme.class);
36
37 public String getName() {
38 return "variable";
39 }
40 public String getShortName() {
41 return "var";
42 }
43
44 public Object load(Property property, RouteContext context) {
45
46
47 LOG.debug("getting variable: " + property.locator);
48 BranchService branchService = KEWServiceLocator.getBranchService();
49 String value = branchService.getScopedVariableValue(context.getNodeInstance().getBranch(), BranchState.VARIABLE_PREFIX + property.locator);
50 LOG.debug("variable '" + property.locator + "': " + value);
51 return value;
52
53
54
55
56
57
58
59
60 }
61
62 public String toString() {
63 return "[VariableScheme]";
64 }
65 }