blob: 940c09559d555597196637299c59ae34a23da1ac [file] [log] [blame]
/**
*/
package org.eclipse.papyrus.bpmn.BPMNProfile.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
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.plugin.EcorePlugin;
import org.eclipse.emf.ecore.util.EObjectValidator;
import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNExpression;
import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNProfilePackage;
import org.eclipse.papyrus.bpmn.BPMNProfile.ComplexGateway;
import org.eclipse.papyrus.bpmn.BPMNProfile.SequenceFlow;
import org.eclipse.papyrus.bpmn.BPMNProfile.util.BPMNProfileValidator;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Complex Gateway</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ComplexGatewayImpl#getDefault <em>Default</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ComplexGatewayImpl#getActivationCondition <em>Activation Condition</em>}</li>
* </ul>
*
* @generated
*/
public class ComplexGatewayImpl extends NonExclusiveGatewayImpl implements ComplexGateway {
/**
* The cached value of the '{@link #getDefault() <em>Default</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDefault()
* @generated
* @ordered
*/
protected SequenceFlow default_;
/**
* The cached value of the '{@link #getActivationCondition() <em>Activation Condition</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getActivationCondition()
* @generated
* @ordered
*/
protected BPMNExpression activationCondition;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ComplexGatewayImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BPMNProfilePackage.eINSTANCE.getComplexGateway();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SequenceFlow getDefault() {
if (default_ != null && default_.eIsProxy()) {
InternalEObject oldDefault = (InternalEObject)default_;
default_ = (SequenceFlow)eResolveProxy(oldDefault);
if (default_ != oldDefault) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.COMPLEX_GATEWAY__DEFAULT, oldDefault, default_));
}
}
return default_;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SequenceFlow basicGetDefault() {
return default_;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDefault(SequenceFlow newDefault) {
SequenceFlow oldDefault = default_;
default_ = newDefault;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.COMPLEX_GATEWAY__DEFAULT, oldDefault, default_));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BPMNExpression getActivationCondition() {
if (activationCondition != null && activationCondition.eIsProxy()) {
InternalEObject oldActivationCondition = (InternalEObject)activationCondition;
activationCondition = (BPMNExpression)eResolveProxy(oldActivationCondition);
if (activationCondition != oldActivationCondition) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.COMPLEX_GATEWAY__ACTIVATION_CONDITION, oldActivationCondition, activationCondition));
}
}
return activationCondition;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BPMNExpression basicGetActivationCondition() {
return activationCondition;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setActivationCondition(BPMNExpression newActivationCondition) {
BPMNExpression oldActivationCondition = activationCondition;
activationCondition = newActivationCondition;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.COMPLEX_GATEWAY__ACTIVATION_CONDITION, oldActivationCondition, activationCondition));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean complexGatewaydefault(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.COMPLEX_GATEWAY__COMPLEX_GATEWAYDEFAULT,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "complexGatewaydefault", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean complexGatewayactivationCondition(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.COMPLEX_GATEWAY__COMPLEX_GATEWAYACTIVATION_CONDITION,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "complexGatewayactivationCondition", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean complexGatewayjoinSpec(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.COMPLEX_GATEWAY__COMPLEX_GATEWAYJOIN_SPEC,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "complexGatewayjoinSpec", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BPMNProfilePackage.COMPLEX_GATEWAY__DEFAULT:
if (resolve) return getDefault();
return basicGetDefault();
case BPMNProfilePackage.COMPLEX_GATEWAY__ACTIVATION_CONDITION:
if (resolve) return getActivationCondition();
return basicGetActivationCondition();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BPMNProfilePackage.COMPLEX_GATEWAY__DEFAULT:
setDefault((SequenceFlow)newValue);
return;
case BPMNProfilePackage.COMPLEX_GATEWAY__ACTIVATION_CONDITION:
setActivationCondition((BPMNExpression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BPMNProfilePackage.COMPLEX_GATEWAY__DEFAULT:
setDefault((SequenceFlow)null);
return;
case BPMNProfilePackage.COMPLEX_GATEWAY__ACTIVATION_CONDITION:
setActivationCondition((BPMNExpression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BPMNProfilePackage.COMPLEX_GATEWAY__DEFAULT:
return default_ != null;
case BPMNProfilePackage.COMPLEX_GATEWAY__ACTIVATION_CONDITION:
return activationCondition != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case BPMNProfilePackage.COMPLEX_GATEWAY___COMPLEX_GATEWAYDEFAULT__DIAGNOSTICCHAIN_MAP:
return complexGatewaydefault((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.COMPLEX_GATEWAY___COMPLEX_GATEWAYACTIVATION_CONDITION__DIAGNOSTICCHAIN_MAP:
return complexGatewayactivationCondition((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.COMPLEX_GATEWAY___COMPLEX_GATEWAYJOIN_SPEC__DIAGNOSTICCHAIN_MAP:
return complexGatewayjoinSpec((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
} //ComplexGatewayImpl