001: /*
002: * $Id: InvokeImpl.java,v 1.17 2004/12/09 12:34:19 kowap Exp $
003: *
004: * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
005: * Berne University of Applied Sciences
006: * School of Engineering and Information Technology
007: * All rights reserved.
008: */
009: package bexee.model.activity.impl;
010:
011: import java.util.ArrayList;
012: import java.util.List;
013:
014: import javax.xml.namespace.QName;
015:
016: import bexee.core.ProcessController;
017: import bexee.core.ProcessInstance;
018: import bexee.model.BPELElementVisitor;
019: import bexee.model.StandardAttributes;
020: import bexee.model.activity.CatchAll;
021: import bexee.model.activity.CompensationHandler;
022: import bexee.model.activity.Invoke;
023: import bexee.model.elements.CatchFault;
024: import bexee.model.elements.Correlations;
025: import bexee.model.elements.PartnerLink;
026: import bexee.model.elements.Variable;
027:
028: /**
029: * Default implementation of the <code>Invoke</code> activity.
030: *
031: * @version $Revision: 1.17 $, $Date: 2004/12/09 12:34:19 $
032: * @author Patric Fornasier
033: * @author Pawel Kowalski
034: */
035: public class InvokeImpl extends AbstractActivity implements Invoke {
036:
037: private PartnerLink partnerLink;
038:
039: private QName portType;
040:
041: private String operation;
042:
043: private Variable inVariable;
044:
045: private Variable outVariable;
046:
047: private Correlations correlations;
048:
049: private List catchFaults;
050:
051: private CatchAll catchAll;
052:
053: private CompensationHandler compensationHandler;
054:
055: //**************************************************/
056: // c'tors
057: //**************************************************/
058:
059: public InvokeImpl() {
060: this (null);
061: }
062:
063: /**
064: * @param standardAttributes
065: */
066: public InvokeImpl(StandardAttributes standardAttributes) {
067: this (standardAttributes, null, null, null, null, null);
068: }
069:
070: /**
071: * @param standardAttributes
072: * @param partnerLink2
073: * @param portType2
074: * @param operation2
075: * @param inVariable
076: * @param outVariable
077: */
078: public InvokeImpl(StandardAttributes standardAttributes,
079: PartnerLink partnerLink, QName portType, String operation,
080: Variable inVariable, Variable outVariable) {
081:
082: super (standardAttributes);
083:
084: init();
085:
086: this .partnerLink = partnerLink;
087: this .portType = portType;
088: this .operation = operation;
089: this .inVariable = inVariable;
090: this .outVariable = outVariable;
091: }
092:
093: private void init() {
094: catchFaults = new ArrayList();
095: }
096:
097: //**************************************************/
098: // bexee.model.activity.Invoke
099: //**************************************************/
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(
170: CompensationHandler compensationHandler) {
171: this .compensationHandler = compensationHandler;
172: }
173:
174: public CompensationHandler getCompensationHandler() {
175: return compensationHandler;
176: }
177:
178: public boolean isSynchronous() {
179: return (outVariable != null);
180: }
181:
182: //**************************************************/
183: // bexee.core.BPELElement
184: //**************************************************/
185:
186: public void accept(ProcessController controller,
187: ProcessInstance instance) throws Exception {
188: controller.process(this , instance);
189: }
190:
191: public void accept(BPELElementVisitor elementVisitor) {
192: elementVisitor.visit(this);
193: }
194: }
|