org.eclipse.bpmn2.impl.CollaborationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kie-wb-common-stunner-bpmn-emf Show documentation
Show all versions of kie-wb-common-stunner-bpmn-emf Show documentation
Kie Workbench - Common - Stunner - BPMN Definition Set - GWT Support for Eclipse EMF/XMI
/**
*
*
* Copyright (c) 2010 SAP AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
*
*
*/
package org.eclipse.bpmn2.impl;
import com.google.gwt.user.client.rpc.GwtTransient;
import java.util.Collection;
import org.eclipse.bpmn2.Artifact;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.Choreography;
import org.eclipse.bpmn2.Collaboration;
import org.eclipse.bpmn2.ConversationAssociation;
import org.eclipse.bpmn2.ConversationLink;
import org.eclipse.bpmn2.ConversationNode;
import org.eclipse.bpmn2.CorrelationKey;
import org.eclipse.bpmn2.MessageFlow;
import org.eclipse.bpmn2.MessageFlowAssociation;
import org.eclipse.bpmn2.Participant;
import org.eclipse.bpmn2.ParticipantAssociation;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Collaboration'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getParticipants Participants}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getMessageFlows Message Flows}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getArtifacts Artifacts}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getConversations Conversations}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getConversationAssociations Conversation Associations}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getParticipantAssociations Participant Associations}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getMessageFlowAssociations Message Flow Associations}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getCorrelationKeys Correlation Keys}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getChoreographyRef Choreography Ref}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getConversationLinks Conversation Links}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#isIsClosed Is Closed}
* - {@link org.eclipse.bpmn2.impl.CollaborationImpl#getName Name}
*
*
* @generated
*/
public class CollaborationImpl extends RootElementImpl implements Collaboration {
/**
* The cached value of the '{@link #getParticipants() Participants}' containment reference list.
*
*
* @see #getParticipants()
* @generated
* @ordered
*/
@GwtTransient
protected EList participants;
/**
* The cached value of the '{@link #getMessageFlows() Message Flows}' containment reference list.
*
*
* @see #getMessageFlows()
* @generated
* @ordered
*/
@GwtTransient
protected EList messageFlows;
/**
* The cached value of the '{@link #getArtifacts() Artifacts}' containment reference list.
*
*
* @see #getArtifacts()
* @generated
* @ordered
*/
@GwtTransient
protected EList artifacts;
/**
* The cached value of the '{@link #getConversations() Conversations}' containment reference list.
*
*
* @see #getConversations()
* @generated
* @ordered
*/
@GwtTransient
protected EList conversations;
/**
* The cached value of the '{@link #getConversationAssociations() Conversation Associations}' containment reference.
*
*
* @see #getConversationAssociations()
* @generated
* @ordered
*/
@GwtTransient
protected ConversationAssociation conversationAssociations;
/**
* The cached value of the '{@link #getParticipantAssociations() Participant Associations}' containment reference list.
*
*
* @see #getParticipantAssociations()
* @generated
* @ordered
*/
@GwtTransient
protected EList participantAssociations;
/**
* The cached value of the '{@link #getMessageFlowAssociations() Message Flow Associations}' containment reference list.
*
*
* @see #getMessageFlowAssociations()
* @generated
* @ordered
*/
@GwtTransient
protected EList messageFlowAssociations;
/**
* The cached value of the '{@link #getCorrelationKeys() Correlation Keys}' containment reference list.
*
*
* @see #getCorrelationKeys()
* @generated
* @ordered
*/
@GwtTransient
protected EList correlationKeys;
/**
* The cached value of the '{@link #getChoreographyRef() Choreography Ref}' reference list.
*
*
* @see #getChoreographyRef()
* @generated
* @ordered
*/
@GwtTransient
protected EList choreographyRef;
/**
* The cached value of the '{@link #getConversationLinks() Conversation Links}' containment reference list.
*
*
* @see #getConversationLinks()
* @generated
* @ordered
*/
@GwtTransient
protected EList conversationLinks;
/**
* The default value of the '{@link #isIsClosed() Is Closed}' attribute.
*
*
* @see #isIsClosed()
* @generated
* @ordered
*/
protected static final boolean IS_CLOSED_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsClosed() Is Closed}' attribute.
*
*
* @see #isIsClosed()
* @generated
* @ordered
*/
@GwtTransient
protected boolean isClosed = IS_CLOSED_EDEFAULT;
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
@GwtTransient
protected String name = NAME_EDEFAULT;
/**
*
*
* @generated
*/
protected CollaborationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.COLLABORATION;
}
/**
*
*
* @generated
*/
@Override
public EList getParticipants() {
if (participants == null) {
participants = new EObjectContainmentEList(Participant.class, this,
Bpmn2Package.COLLABORATION__PARTICIPANTS);
}
return participants;
}
/**
*
*
* @generated
*/
@Override
public EList getMessageFlows() {
if (messageFlows == null) {
messageFlows = new EObjectContainmentEList(MessageFlow.class, this,
Bpmn2Package.COLLABORATION__MESSAGE_FLOWS);
}
return messageFlows;
}
/**
*
*
* @generated
*/
@Override
public EList getArtifacts() {
if (artifacts == null) {
artifacts = new EObjectContainmentEList(Artifact.class, this,
Bpmn2Package.COLLABORATION__ARTIFACTS);
}
return artifacts;
}
/**
*
*
* @generated
*/
@Override
public EList getConversations() {
if (conversations == null) {
conversations = new EObjectContainmentEList(ConversationNode.class, this,
Bpmn2Package.COLLABORATION__CONVERSATIONS);
}
return conversations;
}
/**
*
*
* @generated
*/
@Override
public ConversationAssociation getConversationAssociations() {
return conversationAssociations;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetConversationAssociations(ConversationAssociation newConversationAssociations,
NotificationChain msgs) {
ConversationAssociation oldConversationAssociations = conversationAssociations;
conversationAssociations = newConversationAssociations;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS, oldConversationAssociations,
newConversationAssociations);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setConversationAssociations(ConversationAssociation newConversationAssociations) {
if (newConversationAssociations != conversationAssociations) {
NotificationChain msgs = null;
if (conversationAssociations != null)
msgs = ((InternalEObject) conversationAssociations).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS, null, msgs);
if (newConversationAssociations != null)
msgs = ((InternalEObject) newConversationAssociations).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS, null, msgs);
msgs = basicSetConversationAssociations(newConversationAssociations, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS,
newConversationAssociations, newConversationAssociations));
}
/**
*
*
* @generated
*/
@Override
public EList getParticipantAssociations() {
if (participantAssociations == null) {
participantAssociations = new EObjectContainmentEList(ParticipantAssociation.class,
this, Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS);
}
return participantAssociations;
}
/**
*
*
* @generated
*/
@Override
public EList getMessageFlowAssociations() {
if (messageFlowAssociations == null) {
messageFlowAssociations = new EObjectContainmentEList(MessageFlowAssociation.class,
this, Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS);
}
return messageFlowAssociations;
}
/**
*
*
* @generated
*/
@Override
public EList getCorrelationKeys() {
if (correlationKeys == null) {
correlationKeys = new EObjectContainmentEList(CorrelationKey.class, this,
Bpmn2Package.COLLABORATION__CORRELATION_KEYS);
}
return correlationKeys;
}
/**
*
*
* @generated
*/
@Override
public EList getChoreographyRef() {
if (choreographyRef == null) {
choreographyRef = new EObjectResolvingEList(Choreography.class, this,
Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF);
}
return choreographyRef;
}
/**
*
*
* @generated
*/
@Override
public EList getConversationLinks() {
if (conversationLinks == null) {
conversationLinks = new EObjectContainmentEList(ConversationLink.class, this,
Bpmn2Package.COLLABORATION__CONVERSATION_LINKS);
}
return conversationLinks;
}
/**
*
*
* @generated
*/
@Override
public boolean isIsClosed() {
return isClosed;
}
/**
*
*
* @generated
*/
@Override
public void setIsClosed(boolean newIsClosed) {
boolean oldIsClosed = isClosed;
isClosed = newIsClosed;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COLLABORATION__IS_CLOSED, oldIsClosed,
isClosed));
}
/**
*
*
* @generated
*/
@Override
public String getName() {
return name;
}
/**
*
*
* @generated
*/
@Override
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.COLLABORATION__NAME, oldName, name));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Bpmn2Package.COLLABORATION__PARTICIPANTS:
return ((InternalEList>) getParticipants()).basicRemove(otherEnd, msgs);
case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS:
return ((InternalEList>) getMessageFlows()).basicRemove(otherEnd, msgs);
case Bpmn2Package.COLLABORATION__ARTIFACTS:
return ((InternalEList>) getArtifacts()).basicRemove(otherEnd, msgs);
case Bpmn2Package.COLLABORATION__CONVERSATIONS:
return ((InternalEList>) getConversations()).basicRemove(otherEnd, msgs);
case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS:
return basicSetConversationAssociations(null, msgs);
case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS:
return ((InternalEList>) getParticipantAssociations()).basicRemove(otherEnd, msgs);
case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS:
return ((InternalEList>) getMessageFlowAssociations()).basicRemove(otherEnd, msgs);
case Bpmn2Package.COLLABORATION__CORRELATION_KEYS:
return ((InternalEList>) getCorrelationKeys()).basicRemove(otherEnd, msgs);
case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS:
return ((InternalEList>) getConversationLinks()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.COLLABORATION__PARTICIPANTS:
return getParticipants();
case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS:
return getMessageFlows();
case Bpmn2Package.COLLABORATION__ARTIFACTS:
return getArtifacts();
case Bpmn2Package.COLLABORATION__CONVERSATIONS:
return getConversations();
case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS:
return getConversationAssociations();
case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS:
return getParticipantAssociations();
case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS:
return getMessageFlowAssociations();
case Bpmn2Package.COLLABORATION__CORRELATION_KEYS:
return getCorrelationKeys();
case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF:
return getChoreographyRef();
case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS:
return getConversationLinks();
case Bpmn2Package.COLLABORATION__IS_CLOSED:
return isIsClosed();
case Bpmn2Package.COLLABORATION__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.COLLABORATION__PARTICIPANTS:
getParticipants().clear();
getParticipants().addAll((Collection extends Participant>) newValue);
return;
case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS:
getMessageFlows().clear();
getMessageFlows().addAll((Collection extends MessageFlow>) newValue);
return;
case Bpmn2Package.COLLABORATION__ARTIFACTS:
getArtifacts().clear();
getArtifacts().addAll((Collection extends Artifact>) newValue);
return;
case Bpmn2Package.COLLABORATION__CONVERSATIONS:
getConversations().clear();
getConversations().addAll((Collection extends ConversationNode>) newValue);
return;
case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS:
setConversationAssociations((ConversationAssociation) newValue);
return;
case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS:
getParticipantAssociations().clear();
getParticipantAssociations().addAll((Collection extends ParticipantAssociation>) newValue);
return;
case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS:
getMessageFlowAssociations().clear();
getMessageFlowAssociations().addAll((Collection extends MessageFlowAssociation>) newValue);
return;
case Bpmn2Package.COLLABORATION__CORRELATION_KEYS:
getCorrelationKeys().clear();
getCorrelationKeys().addAll((Collection extends CorrelationKey>) newValue);
return;
case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF:
getChoreographyRef().clear();
getChoreographyRef().addAll((Collection extends Choreography>) newValue);
return;
case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS:
getConversationLinks().clear();
getConversationLinks().addAll((Collection extends ConversationLink>) newValue);
return;
case Bpmn2Package.COLLABORATION__IS_CLOSED:
setIsClosed((Boolean) newValue);
return;
case Bpmn2Package.COLLABORATION__NAME:
setName((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.COLLABORATION__PARTICIPANTS:
getParticipants().clear();
return;
case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS:
getMessageFlows().clear();
return;
case Bpmn2Package.COLLABORATION__ARTIFACTS:
getArtifacts().clear();
return;
case Bpmn2Package.COLLABORATION__CONVERSATIONS:
getConversations().clear();
return;
case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS:
setConversationAssociations((ConversationAssociation) null);
return;
case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS:
getParticipantAssociations().clear();
return;
case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS:
getMessageFlowAssociations().clear();
return;
case Bpmn2Package.COLLABORATION__CORRELATION_KEYS:
getCorrelationKeys().clear();
return;
case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF:
getChoreographyRef().clear();
return;
case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS:
getConversationLinks().clear();
return;
case Bpmn2Package.COLLABORATION__IS_CLOSED:
setIsClosed(IS_CLOSED_EDEFAULT);
return;
case Bpmn2Package.COLLABORATION__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.COLLABORATION__PARTICIPANTS:
return participants != null && !participants.isEmpty();
case Bpmn2Package.COLLABORATION__MESSAGE_FLOWS:
return messageFlows != null && !messageFlows.isEmpty();
case Bpmn2Package.COLLABORATION__ARTIFACTS:
return artifacts != null && !artifacts.isEmpty();
case Bpmn2Package.COLLABORATION__CONVERSATIONS:
return conversations != null && !conversations.isEmpty();
case Bpmn2Package.COLLABORATION__CONVERSATION_ASSOCIATIONS:
return conversationAssociations != null;
case Bpmn2Package.COLLABORATION__PARTICIPANT_ASSOCIATIONS:
return participantAssociations != null && !participantAssociations.isEmpty();
case Bpmn2Package.COLLABORATION__MESSAGE_FLOW_ASSOCIATIONS:
return messageFlowAssociations != null && !messageFlowAssociations.isEmpty();
case Bpmn2Package.COLLABORATION__CORRELATION_KEYS:
return correlationKeys != null && !correlationKeys.isEmpty();
case Bpmn2Package.COLLABORATION__CHOREOGRAPHY_REF:
return choreographyRef != null && !choreographyRef.isEmpty();
case Bpmn2Package.COLLABORATION__CONVERSATION_LINKS:
return conversationLinks != null && !conversationLinks.isEmpty();
case Bpmn2Package.COLLABORATION__IS_CLOSED:
return isClosed != IS_CLOSED_EDEFAULT;
case Bpmn2Package.COLLABORATION__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (isClosed: ");
result.append(isClosed);
result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //CollaborationImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy