org.eclipse.bpmn2.impl.SubProcessImpl 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.FlowElement;
import org.eclipse.bpmn2.FlowElementsContainer;
import org.eclipse.bpmn2.LaneSet;
import org.eclipse.bpmn2.SubProcess;
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.InternalEList;
/**
*
* An implementation of the model object 'Sub Process'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.impl.SubProcessImpl#getLaneSets Lane Sets}
* - {@link org.eclipse.bpmn2.impl.SubProcessImpl#getFlowElements Flow Elements}
* - {@link org.eclipse.bpmn2.impl.SubProcessImpl#getArtifacts Artifacts}
* - {@link org.eclipse.bpmn2.impl.SubProcessImpl#isTriggeredByEvent Triggered By Event}
*
*
* @generated
*/
public class SubProcessImpl extends ActivityImpl implements SubProcess {
/**
* The cached value of the '{@link #getLaneSets() Lane Sets}' containment reference list.
*
*
* @see #getLaneSets()
* @generated
* @ordered
*/
@GwtTransient
protected EList laneSets;
/**
* The cached value of the '{@link #getFlowElements() Flow Elements}' containment reference list.
*
*
* @see #getFlowElements()
* @generated
* @ordered
*/
@GwtTransient
protected EList flowElements;
/**
* The cached value of the '{@link #getArtifacts() Artifacts}' containment reference list.
*
*
* @see #getArtifacts()
* @generated
* @ordered
*/
@GwtTransient
protected EList artifacts;
/**
* The default value of the '{@link #isTriggeredByEvent() Triggered By Event}' attribute.
*
*
* @see #isTriggeredByEvent()
* @generated
* @ordered
*/
protected static final boolean TRIGGERED_BY_EVENT_EDEFAULT = false;
/**
* The cached value of the '{@link #isTriggeredByEvent() Triggered By Event}' attribute.
*
*
* @see #isTriggeredByEvent()
* @generated
* @ordered
*/
@GwtTransient
protected boolean triggeredByEvent = TRIGGERED_BY_EVENT_EDEFAULT;
/**
*
*
* @generated
*/
protected SubProcessImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.SUB_PROCESS;
}
/**
*
*
* @generated
*/
@Override
public EList getLaneSets() {
if (laneSets == null) {
laneSets = new EObjectContainmentEList(LaneSet.class, this, Bpmn2Package.SUB_PROCESS__LANE_SETS);
}
return laneSets;
}
/**
*
*
* @generated
*/
@Override
public EList getFlowElements() {
if (flowElements == null) {
flowElements = new EObjectContainmentEList(FlowElement.class, this,
Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS);
}
return flowElements;
}
/**
*
*
* @generated
*/
@Override
public EList getArtifacts() {
if (artifacts == null) {
artifacts = new EObjectContainmentEList(Artifact.class, this,
Bpmn2Package.SUB_PROCESS__ARTIFACTS);
}
return artifacts;
}
/**
*
*
* @generated
*/
@Override
public boolean isTriggeredByEvent() {
return triggeredByEvent;
}
/**
*
*
* @generated
*/
@Override
public void setTriggeredByEvent(boolean newTriggeredByEvent) {
boolean oldTriggeredByEvent = triggeredByEvent;
triggeredByEvent = newTriggeredByEvent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT,
oldTriggeredByEvent, triggeredByEvent));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Bpmn2Package.SUB_PROCESS__LANE_SETS:
return ((InternalEList>) getLaneSets()).basicRemove(otherEnd, msgs);
case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS:
return ((InternalEList>) getFlowElements()).basicRemove(otherEnd, msgs);
case Bpmn2Package.SUB_PROCESS__ARTIFACTS:
return ((InternalEList>) getArtifacts()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.SUB_PROCESS__LANE_SETS:
return getLaneSets();
case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS:
return getFlowElements();
case Bpmn2Package.SUB_PROCESS__ARTIFACTS:
return getArtifacts();
case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT:
return isTriggeredByEvent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.SUB_PROCESS__LANE_SETS:
getLaneSets().clear();
getLaneSets().addAll((Collection extends LaneSet>) newValue);
return;
case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS:
getFlowElements().clear();
getFlowElements().addAll((Collection extends FlowElement>) newValue);
return;
case Bpmn2Package.SUB_PROCESS__ARTIFACTS:
getArtifacts().clear();
getArtifacts().addAll((Collection extends Artifact>) newValue);
return;
case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT:
setTriggeredByEvent((Boolean) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.SUB_PROCESS__LANE_SETS:
getLaneSets().clear();
return;
case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS:
getFlowElements().clear();
return;
case Bpmn2Package.SUB_PROCESS__ARTIFACTS:
getArtifacts().clear();
return;
case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT:
setTriggeredByEvent(TRIGGERED_BY_EVENT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.SUB_PROCESS__LANE_SETS:
return laneSets != null && !laneSets.isEmpty();
case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS:
return flowElements != null && !flowElements.isEmpty();
case Bpmn2Package.SUB_PROCESS__ARTIFACTS:
return artifacts != null && !artifacts.isEmpty();
case Bpmn2Package.SUB_PROCESS__TRIGGERED_BY_EVENT:
return triggeredByEvent != TRIGGERED_BY_EVENT_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == FlowElementsContainer.class) {
switch (derivedFeatureID) {
case Bpmn2Package.SUB_PROCESS__LANE_SETS:
return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS;
case Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS:
return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS;
default:
return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class> baseClass) {
if (baseClass == FlowElementsContainer.class) {
switch (baseFeatureID) {
case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS:
return Bpmn2Package.SUB_PROCESS__LANE_SETS;
case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS:
return Bpmn2Package.SUB_PROCESS__FLOW_ELEMENTS;
default:
return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (triggeredByEvent: ");
result.append(triggeredByEvent);
result.append(')');
return result.toString();
}
} //SubProcessImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy