1
2
3
4
5
6
7
8
9 package bexee.model.activity.impl;
10
11 import java.util.ArrayList;
12 import java.util.List;
13
14 import javax.xml.namespace.QName;
15
16 import bexee.core.ProcessController;
17 import bexee.core.ProcessInstance;
18 import bexee.model.BPELElementVisitor;
19 import bexee.model.StandardAttributes;
20 import bexee.model.activity.CatchAll;
21 import bexee.model.activity.CompensationHandler;
22 import bexee.model.activity.Invoke;
23 import bexee.model.elements.CatchFault;
24 import bexee.model.elements.Correlations;
25 import bexee.model.elements.PartnerLink;
26 import bexee.model.elements.Variable;
27
28 /***
29 * Default implementation of the <code>Invoke</code> activity.
30 *
31 * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:13 $
32 * @author Patric Fornasier
33 * @author Pawel Kowalski
34 */
35 public class InvokeImpl extends AbstractActivity implements Invoke {
36
37 private PartnerLink partnerLink;
38
39 private QName portType;
40
41 private String operation;
42
43 private Variable inVariable;
44
45 private Variable outVariable;
46
47 private Correlations correlations;
48
49 private List catchFaults;
50
51 private CatchAll catchAll;
52
53 private CompensationHandler compensationHandler;
54
55 //***************************************************/
56
57 //***************************************************/
58
59 public InvokeImpl() {
60 this(null);
61 }
62
63 /***
64 * @param standardAttributes
65 */
66 public InvokeImpl(StandardAttributes standardAttributes) {
67 this(standardAttributes, null, null, null, null, null);
68 }
69
70 /***
71 * @param standardAttributes
72 * @param partnerLink2
73 * @param portType2
74 * @param operation2
75 * @param inVariable
76 * @param outVariable
77 */
78 public InvokeImpl(StandardAttributes standardAttributes,
79 PartnerLink partnerLink, QName portType, String operation,
80 Variable inVariable, Variable outVariable) {
81
82 super(standardAttributes);
83
84 init();
85
86 this.partnerLink = partnerLink;
87 this.portType = portType;
88 this.operation = operation;
89 this.inVariable = inVariable;
90 this.outVariable = outVariable;
91 }
92
93 private void init() {
94 catchFaults = new ArrayList();
95 }
96
97 //***************************************************/
98
99 //***************************************************/
100
101 public void setPartnerLink(PartnerLink partnerLink) {
102 this.partnerLink = partnerLink;
103 }
104
105 public PartnerLink getPartnerLink() {
106 return partnerLink;
107 }
108
109 public void setPortType(QName portType) {
110 this.portType = portType;
111 }
112
113 public QName getPortType() {
114 return portType;
115 }
116
117 public void setOperation(String operation) {
118 this.operation = operation;
119 }
120
121 public String getOperation() {
122 return operation;
123 }
124
125 public void setInputVariable(Variable inputVariable) {
126 this.inVariable = inputVariable;
127 }
128
129 public Variable getInputVariable() {
130 return inVariable;
131 }
132
133 public void setOutputVariable(Variable outputVariable) {
134 this.outVariable = outputVariable;
135 }
136
137 public Variable getOutputVariable() {
138 return outVariable;
139 }
140
141 public void setCorrelations(Correlations correlations) {
142 this.correlations = correlations;
143 }
144
145 public Correlations getCorrelations() {
146 return correlations;
147 }
148
149 public void addCatchFault(CatchFault catchFault) {
150 catchFaults.add(catchFault);
151 }
152
153 public void setCatchFaults(List catchFaults) {
154 this.catchFaults = catchFaults;
155 }
156
157 public List getCatchFaults() {
158 return catchFaults;
159 }
160
161 public void setCatchAll(CatchAll catchAll) {
162 this.catchAll = catchAll;
163 }
164
165 public CatchAll getCatchAll() {
166 return catchAll;
167 }
168
169 public void setCompensationHandler(CompensationHandler compensationHandler) {
170 this.compensationHandler = compensationHandler;
171 }
172
173 public CompensationHandler getCompensationHandler() {
174 return compensationHandler;
175 }
176
177 public boolean isSynchronous() {
178 return (outVariable != null);
179 }
180
181 //***************************************************/
182
183 //***************************************************/
184
185 public void accept(ProcessController controller, ProcessInstance instance)
186 throws Exception {
187 controller.process(this, instance);
188 }
189
190 public void accept(BPELElementVisitor elementVisitor) {
191 elementVisitor.visit(this);
192 }
193 }