All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.omg.bpmn.bpmn2.impl.SequenceFlowImpl Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2012 - 2024 Data In Motion and others.
 * All rights reserved. 
 * 
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 * 
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *      Mark Hoffmann - initial API and implementation
 */
package org.omg.bpmn.bpmn2.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.omg.bpmn.bpmn2.Bpmn2Package;
import org.omg.bpmn.bpmn2.Expression;
import org.omg.bpmn.bpmn2.FlowNode;
import org.omg.bpmn.bpmn2.SequenceFlow;

/**
 * 
 * An implementation of the model object 'Sequence Flow'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.omg.bpmn.bpmn2.impl.SequenceFlowImpl#getConditionExpression Condition Expression}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.SequenceFlowImpl#isIsImmediate Is Immediate}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.SequenceFlowImpl#getSourceRef Source Ref}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.SequenceFlowImpl#getTargetRef Target Ref}
  • *
* * @generated */ public class SequenceFlowImpl extends FlowElementImpl implements SequenceFlow { /** * The cached value of the '{@link #getConditionExpression() Condition Expression}' containment reference. * * * @see #getConditionExpression() * @generated * @ordered */ protected Expression conditionExpression; /** * The default value of the '{@link #isIsImmediate() Is Immediate}' attribute. * * * @see #isIsImmediate() * @generated * @ordered */ protected static final boolean IS_IMMEDIATE_EDEFAULT = false; /** * The cached value of the '{@link #isIsImmediate() Is Immediate}' attribute. * * * @see #isIsImmediate() * @generated * @ordered */ protected boolean isImmediate = IS_IMMEDIATE_EDEFAULT; /** * The cached value of the '{@link #getSourceRef() Source Ref}' reference. * * * @see #getSourceRef() * @generated * @ordered */ protected FlowNode sourceRef; /** * The cached value of the '{@link #getTargetRef() Target Ref}' reference. * * * @see #getTargetRef() * @generated * @ordered */ protected FlowNode targetRef; /** * * * @generated */ protected SequenceFlowImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return Bpmn2Package.eINSTANCE.getSequenceFlow(); } /** * * * @generated */ @Override public Expression getConditionExpression() { return conditionExpression; } /** * * * @generated */ public NotificationChain basicSetConditionExpression(Expression newConditionExpression, NotificationChain msgs) { Expression oldConditionExpression = conditionExpression; conditionExpression = newConditionExpression; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, oldConditionExpression, newConditionExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setConditionExpression(Expression newConditionExpression) { if (newConditionExpression != conditionExpression) { NotificationChain msgs = null; if (conditionExpression != null) msgs = ((InternalEObject)conditionExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, null, msgs); if (newConditionExpression != null) msgs = ((InternalEObject)newConditionExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, null, msgs); msgs = basicSetConditionExpression(newConditionExpression, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION, newConditionExpression, newConditionExpression)); } /** * * * @generated */ @Override public boolean isIsImmediate() { return isImmediate; } /** * * * @generated */ @Override public void setIsImmediate(boolean newIsImmediate) { boolean oldIsImmediate = isImmediate; isImmediate = newIsImmediate; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE, oldIsImmediate, isImmediate)); } /** * * * @generated */ @Override public FlowNode getSourceRef() { return sourceRef; } /** * * * @generated */ public NotificationChain basicSetSourceRef(FlowNode newSourceRef, NotificationChain msgs) { FlowNode oldSourceRef = sourceRef; sourceRef = newSourceRef; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF, oldSourceRef, newSourceRef); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setSourceRef(FlowNode newSourceRef) { if (newSourceRef != sourceRef) { NotificationChain msgs = null; if (sourceRef != null) msgs = ((InternalEObject)sourceRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__OUTGOING, FlowNode.class, msgs); if (newSourceRef != null) msgs = ((InternalEObject)newSourceRef).eInverseAdd(this, Bpmn2Package.FLOW_NODE__OUTGOING, FlowNode.class, msgs); msgs = basicSetSourceRef(newSourceRef, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF, newSourceRef, newSourceRef)); } /** * * * @generated */ @Override public FlowNode getTargetRef() { return targetRef; } /** * * * @generated */ public NotificationChain basicSetTargetRef(FlowNode newTargetRef, NotificationChain msgs) { FlowNode oldTargetRef = targetRef; targetRef = newTargetRef; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__TARGET_REF, oldTargetRef, newTargetRef); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setTargetRef(FlowNode newTargetRef) { if (newTargetRef != targetRef) { NotificationChain msgs = null; if (targetRef != null) msgs = ((InternalEObject)targetRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__INCOMING, FlowNode.class, msgs); if (newTargetRef != null) msgs = ((InternalEObject)newTargetRef).eInverseAdd(this, Bpmn2Package.FLOW_NODE__INCOMING, FlowNode.class, msgs); msgs = basicSetTargetRef(newTargetRef, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SEQUENCE_FLOW__TARGET_REF, newTargetRef, newTargetRef)); } /** * * * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: if (sourceRef != null) msgs = ((InternalEObject)sourceRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__OUTGOING, FlowNode.class, msgs); return basicSetSourceRef((FlowNode)otherEnd, msgs); case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: if (targetRef != null) msgs = ((InternalEObject)targetRef).eInverseRemove(this, Bpmn2Package.FLOW_NODE__INCOMING, FlowNode.class, msgs); return basicSetTargetRef((FlowNode)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: return basicSetConditionExpression(null, msgs); case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: return basicSetSourceRef(null, msgs); case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: return basicSetTargetRef(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: return getConditionExpression(); case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: return isIsImmediate(); case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: return getSourceRef(); case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: return getTargetRef(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: setConditionExpression((Expression)newValue); return; case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: setIsImmediate((Boolean)newValue); return; case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: setSourceRef((FlowNode)newValue); return; case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: setTargetRef((FlowNode)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: setConditionExpression((Expression)null); return; case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: setIsImmediate(IS_IMMEDIATE_EDEFAULT); return; case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: setSourceRef((FlowNode)null); return; case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: setTargetRef((FlowNode)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Bpmn2Package.SEQUENCE_FLOW__CONDITION_EXPRESSION: return conditionExpression != null; case Bpmn2Package.SEQUENCE_FLOW__IS_IMMEDIATE: return isImmediate != IS_IMMEDIATE_EDEFAULT; case Bpmn2Package.SEQUENCE_FLOW__SOURCE_REF: return sourceRef != null; case Bpmn2Package.SEQUENCE_FLOW__TARGET_REF: return targetRef != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (isImmediate: "); result.append(isImmediate); result.append(')'); return result.toString(); } } //SequenceFlowImpl




© 2015 - 2024 Weber Informatics LLC | Privacy Policy