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

org.eclipse.bpmn2.impl.ProcessImpl Maven / Gradle / Ivy

There is a newer version: 7.54.0.Final
Show newest version
/**
 * 
 * 
 * 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.Auditing;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.Collaboration;
import org.eclipse.bpmn2.CorrelationSubscription;
import org.eclipse.bpmn2.FlowElement;
import org.eclipse.bpmn2.FlowElementsContainer;
import org.eclipse.bpmn2.LaneSet;
import org.eclipse.bpmn2.Monitoring;
import org.eclipse.bpmn2.ProcessType;
import org.eclipse.bpmn2.Property;
import org.eclipse.bpmn2.ResourceRole;

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 'Process'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getLaneSets Lane Sets}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getFlowElements Flow Elements}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getAuditing Auditing}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getMonitoring Monitoring}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getProperties Properties}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getArtifacts Artifacts}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getResources Resources}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getCorrelationSubscriptions Correlation Subscriptions}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getSupports Supports}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getDefinitionalCollaborationRef Definitional Collaboration Ref}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#isIsClosed Is Closed}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#isIsExecutable Is Executable}
  • *
  • {@link org.eclipse.bpmn2.impl.ProcessImpl#getProcessType Process Type}
  • *
* * @generated */ public class ProcessImpl extends CallableElementImpl implements org.eclipse.bpmn2.Process { /** * 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 #getAuditing() Auditing}' containment reference. * * * @see #getAuditing() * @generated * @ordered */ @GwtTransient protected Auditing auditing; /** * The cached value of the '{@link #getMonitoring() Monitoring}' containment reference. * * * @see #getMonitoring() * @generated * @ordered */ @GwtTransient protected Monitoring monitoring; /** * The cached value of the '{@link #getProperties() Properties}' containment reference list. * * * @see #getProperties() * @generated * @ordered */ @GwtTransient protected EList properties; /** * 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 #getResources() Resources}' containment reference list. * * * @see #getResources() * @generated * @ordered */ @GwtTransient protected EList resources; /** * The cached value of the '{@link #getCorrelationSubscriptions() Correlation Subscriptions}' containment reference list. * * * @see #getCorrelationSubscriptions() * @generated * @ordered */ @GwtTransient protected EList correlationSubscriptions; /** * The cached value of the '{@link #getSupports() Supports}' reference list. * * * @see #getSupports() * @generated * @ordered */ @GwtTransient protected EList supports; /** * The cached value of the '{@link #getDefinitionalCollaborationRef() Definitional Collaboration Ref}' reference. * * * @see #getDefinitionalCollaborationRef() * @generated * @ordered */ @GwtTransient protected Collaboration definitionalCollaborationRef; /** * 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 #isIsExecutable() Is Executable}' attribute. * * * @see #isIsExecutable() * @generated * @ordered */ protected static final boolean IS_EXECUTABLE_EDEFAULT = false; /** * The cached value of the '{@link #isIsExecutable() Is Executable}' attribute. * * * @see #isIsExecutable() * @generated * @ordered */ @GwtTransient protected boolean isExecutable = IS_EXECUTABLE_EDEFAULT; /** * The default value of the '{@link #getProcessType() Process Type}' attribute. * * * @see #getProcessType() * @generated * @ordered */ protected static final ProcessType PROCESS_TYPE_EDEFAULT = ProcessType.NONE; /** * The cached value of the '{@link #getProcessType() Process Type}' attribute. * * * @see #getProcessType() * @generated * @ordered */ @GwtTransient protected ProcessType processType = PROCESS_TYPE_EDEFAULT; /** * * * @generated */ protected ProcessImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return Bpmn2Package.Literals.PROCESS; } /** * * * @generated */ @Override public EList getLaneSets() { if (laneSets == null) { laneSets = new EObjectContainmentEList(LaneSet.class, this, Bpmn2Package.PROCESS__LANE_SETS); } return laneSets; } /** * * * @generated */ @Override public EList getFlowElements() { if (flowElements == null) { flowElements = new EObjectContainmentEList(FlowElement.class, this, Bpmn2Package.PROCESS__FLOW_ELEMENTS); } return flowElements; } /** * * * @generated */ @Override public Auditing getAuditing() { return auditing; } /** * * * @generated */ public NotificationChain basicSetAuditing(Auditing newAuditing, NotificationChain msgs) { Auditing oldAuditing = auditing; auditing = newAuditing; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__AUDITING, oldAuditing, newAuditing); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setAuditing(Auditing newAuditing) { if (newAuditing != auditing) { NotificationChain msgs = null; if (auditing != null) msgs = ((InternalEObject) auditing).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__AUDITING, null, msgs); if (newAuditing != null) msgs = ((InternalEObject) newAuditing).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__AUDITING, null, msgs); msgs = basicSetAuditing(newAuditing, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__AUDITING, newAuditing, newAuditing)); } /** * * * @generated */ @Override public Monitoring getMonitoring() { return monitoring; } /** * * * @generated */ public NotificationChain basicSetMonitoring(Monitoring newMonitoring, NotificationChain msgs) { Monitoring oldMonitoring = monitoring; monitoring = newMonitoring; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__MONITORING, oldMonitoring, newMonitoring); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setMonitoring(Monitoring newMonitoring) { if (newMonitoring != monitoring) { NotificationChain msgs = null; if (monitoring != null) msgs = ((InternalEObject) monitoring).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__MONITORING, null, msgs); if (newMonitoring != null) msgs = ((InternalEObject) newMonitoring).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Bpmn2Package.PROCESS__MONITORING, null, msgs); msgs = basicSetMonitoring(newMonitoring, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__MONITORING, newMonitoring, newMonitoring)); } /** * * * @generated */ @Override public EList getProperties() { if (properties == null) { properties = new EObjectContainmentEList(Property.class, this, Bpmn2Package.PROCESS__PROPERTIES); } return properties; } /** * * * @generated */ @Override public EList getArtifacts() { if (artifacts == null) { artifacts = new EObjectContainmentEList(Artifact.class, this, Bpmn2Package.PROCESS__ARTIFACTS); } return artifacts; } /** * * * @generated */ @Override public EList getResources() { if (resources == null) { resources = new EObjectContainmentEList(ResourceRole.class, this, Bpmn2Package.PROCESS__RESOURCES); } return resources; } /** * * * @generated */ @Override public EList getCorrelationSubscriptions() { if (correlationSubscriptions == null) { correlationSubscriptions = new EObjectContainmentEList( CorrelationSubscription.class, this, Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS); } return correlationSubscriptions; } /** * * * @generated */ @Override public EList getSupports() { if (supports == null) { supports = new EObjectResolvingEList(org.eclipse.bpmn2.Process.class, this, Bpmn2Package.PROCESS__SUPPORTS); } return supports; } /** * * * @generated */ @Override public Collaboration getDefinitionalCollaborationRef() { if (definitionalCollaborationRef != null && definitionalCollaborationRef.eIsProxy()) { InternalEObject oldDefinitionalCollaborationRef = (InternalEObject) definitionalCollaborationRef; definitionalCollaborationRef = (Collaboration) eResolveProxy(oldDefinitionalCollaborationRef); if (definitionalCollaborationRef != oldDefinitionalCollaborationRef) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF, oldDefinitionalCollaborationRef, definitionalCollaborationRef)); } } return definitionalCollaborationRef; } /** * * * @generated */ public Collaboration basicGetDefinitionalCollaborationRef() { return definitionalCollaborationRef; } /** * * * @generated */ @Override public void setDefinitionalCollaborationRef(Collaboration newDefinitionalCollaborationRef) { Collaboration oldDefinitionalCollaborationRef = definitionalCollaborationRef; definitionalCollaborationRef = newDefinitionalCollaborationRef; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF, oldDefinitionalCollaborationRef, definitionalCollaborationRef)); } /** * * * @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.PROCESS__IS_CLOSED, oldIsClosed, isClosed)); } /** * * * @generated */ @Override public boolean isIsExecutable() { return isExecutable; } /** * * * @generated */ @Override public void setIsExecutable(boolean newIsExecutable) { boolean oldIsExecutable = isExecutable; isExecutable = newIsExecutable; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__IS_EXECUTABLE, oldIsExecutable, isExecutable)); } /** * * * @generated */ @Override public ProcessType getProcessType() { return processType; } /** * * * @generated */ @Override public void setProcessType(ProcessType newProcessType) { ProcessType oldProcessType = processType; processType = newProcessType == null ? PROCESS_TYPE_EDEFAULT : newProcessType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.PROCESS__PROCESS_TYPE, oldProcessType, processType)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Bpmn2Package.PROCESS__LANE_SETS: return ((InternalEList) getLaneSets()).basicRemove(otherEnd, msgs); case Bpmn2Package.PROCESS__FLOW_ELEMENTS: return ((InternalEList) getFlowElements()).basicRemove(otherEnd, msgs); case Bpmn2Package.PROCESS__AUDITING: return basicSetAuditing(null, msgs); case Bpmn2Package.PROCESS__MONITORING: return basicSetMonitoring(null, msgs); case Bpmn2Package.PROCESS__PROPERTIES: return ((InternalEList) getProperties()).basicRemove(otherEnd, msgs); case Bpmn2Package.PROCESS__ARTIFACTS: return ((InternalEList) getArtifacts()).basicRemove(otherEnd, msgs); case Bpmn2Package.PROCESS__RESOURCES: return ((InternalEList) getResources()).basicRemove(otherEnd, msgs); case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: return ((InternalEList) getCorrelationSubscriptions()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Bpmn2Package.PROCESS__LANE_SETS: return getLaneSets(); case Bpmn2Package.PROCESS__FLOW_ELEMENTS: return getFlowElements(); case Bpmn2Package.PROCESS__AUDITING: return getAuditing(); case Bpmn2Package.PROCESS__MONITORING: return getMonitoring(); case Bpmn2Package.PROCESS__PROPERTIES: return getProperties(); case Bpmn2Package.PROCESS__ARTIFACTS: return getArtifacts(); case Bpmn2Package.PROCESS__RESOURCES: return getResources(); case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: return getCorrelationSubscriptions(); case Bpmn2Package.PROCESS__SUPPORTS: return getSupports(); case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: if (resolve) return getDefinitionalCollaborationRef(); return basicGetDefinitionalCollaborationRef(); case Bpmn2Package.PROCESS__IS_CLOSED: return isIsClosed(); case Bpmn2Package.PROCESS__IS_EXECUTABLE: return isIsExecutable(); case Bpmn2Package.PROCESS__PROCESS_TYPE: return getProcessType(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Bpmn2Package.PROCESS__LANE_SETS: getLaneSets().clear(); getLaneSets().addAll((Collection) newValue); return; case Bpmn2Package.PROCESS__FLOW_ELEMENTS: getFlowElements().clear(); getFlowElements().addAll((Collection) newValue); return; case Bpmn2Package.PROCESS__AUDITING: setAuditing((Auditing) newValue); return; case Bpmn2Package.PROCESS__MONITORING: setMonitoring((Monitoring) newValue); return; case Bpmn2Package.PROCESS__PROPERTIES: getProperties().clear(); getProperties().addAll((Collection) newValue); return; case Bpmn2Package.PROCESS__ARTIFACTS: getArtifacts().clear(); getArtifacts().addAll((Collection) newValue); return; case Bpmn2Package.PROCESS__RESOURCES: getResources().clear(); getResources().addAll((Collection) newValue); return; case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: getCorrelationSubscriptions().clear(); getCorrelationSubscriptions().addAll((Collection) newValue); return; case Bpmn2Package.PROCESS__SUPPORTS: getSupports().clear(); getSupports().addAll((Collection) newValue); return; case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: setDefinitionalCollaborationRef((Collaboration) newValue); return; case Bpmn2Package.PROCESS__IS_CLOSED: setIsClosed((Boolean) newValue); return; case Bpmn2Package.PROCESS__IS_EXECUTABLE: setIsExecutable((Boolean) newValue); return; case Bpmn2Package.PROCESS__PROCESS_TYPE: setProcessType((ProcessType) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Bpmn2Package.PROCESS__LANE_SETS: getLaneSets().clear(); return; case Bpmn2Package.PROCESS__FLOW_ELEMENTS: getFlowElements().clear(); return; case Bpmn2Package.PROCESS__AUDITING: setAuditing((Auditing) null); return; case Bpmn2Package.PROCESS__MONITORING: setMonitoring((Monitoring) null); return; case Bpmn2Package.PROCESS__PROPERTIES: getProperties().clear(); return; case Bpmn2Package.PROCESS__ARTIFACTS: getArtifacts().clear(); return; case Bpmn2Package.PROCESS__RESOURCES: getResources().clear(); return; case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: getCorrelationSubscriptions().clear(); return; case Bpmn2Package.PROCESS__SUPPORTS: getSupports().clear(); return; case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: setDefinitionalCollaborationRef((Collaboration) null); return; case Bpmn2Package.PROCESS__IS_CLOSED: setIsClosed(IS_CLOSED_EDEFAULT); return; case Bpmn2Package.PROCESS__IS_EXECUTABLE: setIsExecutable(IS_EXECUTABLE_EDEFAULT); return; case Bpmn2Package.PROCESS__PROCESS_TYPE: setProcessType(PROCESS_TYPE_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Bpmn2Package.PROCESS__LANE_SETS: return laneSets != null && !laneSets.isEmpty(); case Bpmn2Package.PROCESS__FLOW_ELEMENTS: return flowElements != null && !flowElements.isEmpty(); case Bpmn2Package.PROCESS__AUDITING: return auditing != null; case Bpmn2Package.PROCESS__MONITORING: return monitoring != null; case Bpmn2Package.PROCESS__PROPERTIES: return properties != null && !properties.isEmpty(); case Bpmn2Package.PROCESS__ARTIFACTS: return artifacts != null && !artifacts.isEmpty(); case Bpmn2Package.PROCESS__RESOURCES: return resources != null && !resources.isEmpty(); case Bpmn2Package.PROCESS__CORRELATION_SUBSCRIPTIONS: return correlationSubscriptions != null && !correlationSubscriptions.isEmpty(); case Bpmn2Package.PROCESS__SUPPORTS: return supports != null && !supports.isEmpty(); case Bpmn2Package.PROCESS__DEFINITIONAL_COLLABORATION_REF: return definitionalCollaborationRef != null; case Bpmn2Package.PROCESS__IS_CLOSED: return isClosed != IS_CLOSED_EDEFAULT; case Bpmn2Package.PROCESS__IS_EXECUTABLE: return isExecutable != IS_EXECUTABLE_EDEFAULT; case Bpmn2Package.PROCESS__PROCESS_TYPE: return processType != PROCESS_TYPE_EDEFAULT; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { if (baseClass == FlowElementsContainer.class) { switch (derivedFeatureID) { case Bpmn2Package.PROCESS__LANE_SETS: return Bpmn2Package.FLOW_ELEMENTS_CONTAINER__LANE_SETS; case Bpmn2Package.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.PROCESS__LANE_SETS; case Bpmn2Package.FLOW_ELEMENTS_CONTAINER__FLOW_ELEMENTS: return Bpmn2Package.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(" (isClosed: "); result.append(isClosed); result.append(", isExecutable: "); result.append(isExecutable); result.append(", processType: "); result.append(processType); result.append(')'); return result.toString(); } } //ProcessImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy