1
2
3
4
5
6
7
8
9 package bexee.model.activity.impl;
10
11 import javax.xml.namespace.QName;
12
13 import bexee.core.ProcessController;
14 import bexee.core.ProcessInstance;
15 import bexee.model.BPELElementVisitor;
16 import bexee.model.StandardAttributes;
17 import bexee.model.activity.Receive;
18 import bexee.model.elements.Correlations;
19 import bexee.model.elements.PartnerLink;
20 import bexee.model.elements.Variable;
21
22 /***
23 * Default implementation of the <code>Receive</code> activity.
24 *
25 * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:13 $
26 * @author Patric Fornasier
27 * @author Pawel Kowalski
28 */
29 public class ReceiveImpl extends AbstractActivity implements Receive {
30
31 private PartnerLink partnerLink;
32
33 private String partnerLinkName;
34
35 private QName portType;
36
37 private String operation;
38
39 private Variable variable;
40
41 private boolean createInstance = false;
42
43 private Correlations correlations;
44
45 //***************************************************/
46
47 //***************************************************/
48
49 public ReceiveImpl() {
50 this(null);
51 }
52
53 /***
54 * @param standardAttributes
55 */
56 public ReceiveImpl(StandardAttributes standardAttributes) {
57 this(standardAttributes, null, null, null, null, null);
58 }
59
60 /***
61 * @param standardAttributes
62 * @param link
63 * @param portTypeQName
64 * @param operation2
65 * @param variable2
66 * @param createInstance2
67 */
68 public ReceiveImpl(StandardAttributes standardAttributes,
69 PartnerLink partnerLink, QName portType, String operation,
70 Variable variable, String createInstance) {
71
72 super(standardAttributes);
73
74 this.partnerLink = partnerLink;
75 this.portType = portType;
76 this.operation = operation;
77 this.variable = variable;
78
79 this.createInstance = getValidValueOrDefault(createInstance,
80 DEFAULT_CREATE_ACTIVITY);
81 }
82
83 //***************************************************/
84
85 //***************************************************/
86
87 public void setPartnerLink(PartnerLink partnerLink) {
88 this.partnerLink = partnerLink;
89 }
90
91 public PartnerLink getPartnerLink() {
92 return partnerLink;
93 }
94
95 public void setPortType(QName portType) {
96 this.portType = portType;
97 }
98
99 public QName getPortType() {
100 return portType;
101 }
102
103 public void setOperation(String operation) {
104 this.operation = operation;
105 }
106
107 public String getOperation() {
108 return operation;
109 }
110
111 public void setVariable(Variable variable) {
112 this.variable = variable;
113 }
114
115 public Variable getVariable() {
116 return variable;
117 }
118
119 public void setCreateInstance(boolean createInstance) {
120 this.createInstance = createInstance;
121 }
122
123 public boolean isCreateInstance() {
124 return createInstance;
125 }
126
127 public void setCorrelations(Correlations correlations) {
128 this.correlations = correlations;
129 }
130
131 public Correlations getCorrelations() {
132 return correlations;
133 }
134
135 //***************************************************/
136
137 //***************************************************/
138
139 public void accept(ProcessController controller, ProcessInstance instance)
140 throws Exception {
141 controller.process(this, instance);
142 }
143
144 public void accept(BPELElementVisitor elementVisitor) {
145 elementVisitor.visit(this);
146 }
147 }