1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.scxml.model;
19
20 import java.util.HashMap;
21 import java.util.Map;
22
23 import org.apache.commons.scxml.PathResolver;
24
25 /***
26 * The class in this SCXML object model that corresponds to the
27 * <invoke> SCXML element.
28 *
29 */
30 public class Invoke implements PathResolverHolder {
31
32 /***
33 * The type of target to be invoked.
34 */
35 private String targettype;
36
37 /***
38 * The source URL for the external service.
39 */
40 private String src;
41
42 /***
43 * The expression that evaluates to the source URL for the
44 * external service.
45 */
46 private String srcexpr;
47
48 /***
49 * The Map of the params to be sent to the invoked process.
50 */
51 private Map params;
52
53 /***
54 * The <finalize> child, may be null.
55 */
56 private Finalize finalize;
57
58 /***
59 * {@link PathResolver} for resolving the "src" or "srcexpr" result.
60 */
61 private PathResolver pathResolver;
62
63 /***
64 * Default no-args constructor for Digester.
65 */
66 public Invoke() {
67 params = new HashMap();
68 }
69
70 /***
71 * Get the target type for this <invoke> element.
72 *
73 * @return String Returns the targettype.
74 */
75 public final String getTargettype() {
76 return targettype;
77 }
78
79 /***
80 * Set the target type for this <invoke> element.
81 *
82 * @param targettype The targettype to set.
83 */
84 public final void setTargettype(final String targettype) {
85 this.targettype = targettype;
86 }
87
88 /***
89 * Get the URL for the external service.
90 *
91 * @return String The URL.
92 */
93 public final String getSrc() {
94 return src;
95 }
96
97 /***
98 * Set the URL for the external service.
99 *
100 * @param src The source URL.
101 */
102 public final void setSrc(final String src) {
103 this.src = src;
104 }
105
106 /***
107 * Get the expression that evaluates to the source URL for the
108 * external service.
109 *
110 * @return String The source expression.
111 */
112 public final String getSrcexpr() {
113 return srcexpr;
114 }
115
116 /***
117 * Set the expression that evaluates to the source URL for the
118 * external service.
119 *
120 * @param srcexpr The source expression.
121 */
122 public final void setSrcexpr(final String srcexpr) {
123 this.srcexpr = srcexpr;
124 }
125
126 /***
127 * Get the params Map.
128 *
129 * @return Map The params map.
130 */
131 public final Map getParams() {
132 return params;
133 }
134
135 /***
136 * Add this param to this invoke.
137 *
138 * @param param The invoke parameter.
139 */
140 public final void addParam(final Param param) {
141 params.put(param.getName(), param.getExpr());
142 }
143
144 /***
145 * Get the Finalize for this Invoke.
146 *
147 * @return Finalize The Finalize for this Invoke.
148 */
149 public final Finalize getFinalize() {
150 return finalize;
151 }
152
153 /***
154 * Set the Finalize for this Invoke.
155 *
156 * @param finalize The Finalize for this Invoke.
157 */
158 public final void setFinalize(final Finalize finalize) {
159 this.finalize = finalize;
160 }
161
162 /***
163 * Get the {@link PathResolver}.
164 *
165 * @return Returns the pathResolver.
166 */
167 public PathResolver getPathResolver() {
168 return pathResolver;
169 }
170
171 /***
172 * Set the {@link PathResolver}.
173 *
174 * @param pathResolver The pathResolver to set.
175 */
176 public void setPathResolver(final PathResolver pathResolver) {
177 this.pathResolver = pathResolver;
178 }
179
180 }
181