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