001: /*
002: * $Id: ReceiveImpl.java,v 1.15 2004/12/09 12:34:21 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 javax.xml.namespace.QName;
012:
013: import bexee.core.ProcessController;
014: import bexee.core.ProcessInstance;
015: import bexee.model.BPELElementVisitor;
016: import bexee.model.StandardAttributes;
017: import bexee.model.activity.Receive;
018: import bexee.model.elements.Correlations;
019: import bexee.model.elements.PartnerLink;
020: import bexee.model.elements.Variable;
021:
022: /**
023: * Default implementation of the <code>Receive</code> activity.
024: *
025: * @version $Revision: 1.15 $, $Date: 2004/12/09 12:34:21 $
026: * @author Patric Fornasier
027: * @author Pawel Kowalski
028: */
029: public class ReceiveImpl extends AbstractActivity implements Receive {
030:
031: private PartnerLink partnerLink;
032:
033: private String partnerLinkName;
034:
035: private QName portType;
036:
037: private String operation;
038:
039: private Variable variable;
040:
041: private boolean createInstance = false;
042:
043: private Correlations correlations;
044:
045: //**************************************************/
046: // c'tors
047: //**************************************************/
048:
049: public ReceiveImpl() {
050: this (null);
051: }
052:
053: /**
054: * @param standardAttributes
055: */
056: public ReceiveImpl(StandardAttributes standardAttributes) {
057: this (standardAttributes, null, null, null, null, null);
058: }
059:
060: /**
061: * @param standardAttributes
062: * @param link
063: * @param portTypeQName
064: * @param operation2
065: * @param variable2
066: * @param createInstance2
067: */
068: public ReceiveImpl(StandardAttributes standardAttributes,
069: PartnerLink partnerLink, QName portType, String operation,
070: Variable variable, String createInstance) {
071:
072: super (standardAttributes);
073:
074: this .partnerLink = partnerLink;
075: this .portType = portType;
076: this .operation = operation;
077: this .variable = variable;
078:
079: this .createInstance = getValidValueOrDefault(createInstance,
080: DEFAULT_CREATE_ACTIVITY);
081: }
082:
083: //**************************************************/
084: // bexee.model.activity.Receive
085: //**************************************************/
086:
087: public void setPartnerLink(PartnerLink partnerLink) {
088: this .partnerLink = partnerLink;
089: }
090:
091: public PartnerLink getPartnerLink() {
092: return partnerLink;
093: }
094:
095: public void setPortType(QName portType) {
096: this .portType = portType;
097: }
098:
099: 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: // bexee.core.BPELElement
137: //**************************************************/
138:
139: public void accept(ProcessController controller,
140: ProcessInstance instance) throws Exception {
141: controller.process(this , instance);
142: }
143:
144: public void accept(BPELElementVisitor elementVisitor) {
145: elementVisitor.visit(this);
146: }
147: }
|