org.eclipse.bpmn2.impl.ActivityImpl 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.Activity;
import org.eclipse.bpmn2.BoundaryEvent;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.DataInputAssociation;
import org.eclipse.bpmn2.DataOutputAssociation;
import org.eclipse.bpmn2.InputOutputSpecification;
import org.eclipse.bpmn2.LoopCharacteristics;
import org.eclipse.bpmn2.Property;
import org.eclipse.bpmn2.ResourceRole;
import org.eclipse.bpmn2.SequenceFlow;
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.EObjectWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Activity'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getIoSpecification Io Specification}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getBoundaryEventRefs Boundary Event Refs}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getProperties Properties}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getDataInputAssociations Data Input Associations}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getDataOutputAssociations Data Output Associations}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getResources Resources}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getLoopCharacteristics Loop Characteristics}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getCompletionQuantity Completion Quantity}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getDefault Default}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#isIsForCompensation Is For Compensation}
* - {@link org.eclipse.bpmn2.impl.ActivityImpl#getStartQuantity Start Quantity}
*
*
* @generated
*/
public class ActivityImpl extends FlowNodeImpl implements Activity {
/**
* The cached value of the '{@link #getIoSpecification() Io Specification}' containment reference.
*
*
* @see #getIoSpecification()
* @generated
* @ordered
*/
@GwtTransient
protected InputOutputSpecification ioSpecification;
/**
* The cached value of the '{@link #getBoundaryEventRefs() Boundary Event Refs}' reference list.
*
*
* @see #getBoundaryEventRefs()
* @generated
* @ordered
*/
@GwtTransient
protected EList boundaryEventRefs;
/**
* 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 #getDataInputAssociations() Data Input Associations}' containment reference list.
*
*
* @see #getDataInputAssociations()
* @generated
* @ordered
*/
@GwtTransient
protected EList dataInputAssociations;
/**
* The cached value of the '{@link #getDataOutputAssociations() Data Output Associations}' containment reference list.
*
*
* @see #getDataOutputAssociations()
* @generated
* @ordered
*/
@GwtTransient
protected EList dataOutputAssociations;
/**
* 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 #getLoopCharacteristics() Loop Characteristics}' containment reference.
*
*
* @see #getLoopCharacteristics()
* @generated
* @ordered
*/
@GwtTransient
protected LoopCharacteristics loopCharacteristics;
/**
* The default value of the '{@link #getCompletionQuantity() Completion Quantity}' attribute.
*
*
* @see #getCompletionQuantity()
* @generated
* @ordered
*/
protected static final int COMPLETION_QUANTITY_EDEFAULT = 1;
/**
* The cached value of the '{@link #getCompletionQuantity() Completion Quantity}' attribute.
*
*
* @see #getCompletionQuantity()
* @generated
* @ordered
*/
@GwtTransient
protected int completionQuantity = COMPLETION_QUANTITY_EDEFAULT;
/**
* The cached value of the '{@link #getDefault() Default}' reference.
*
*
* @see #getDefault()
* @generated
* @ordered
*/
@GwtTransient
protected SequenceFlow default_;
/**
* The default value of the '{@link #isIsForCompensation() Is For Compensation}' attribute.
*
*
* @see #isIsForCompensation()
* @generated
* @ordered
*/
protected static final boolean IS_FOR_COMPENSATION_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsForCompensation() Is For Compensation}' attribute.
*
*
* @see #isIsForCompensation()
* @generated
* @ordered
*/
@GwtTransient
protected boolean isForCompensation = IS_FOR_COMPENSATION_EDEFAULT;
/**
* The default value of the '{@link #getStartQuantity() Start Quantity}' attribute.
*
*
* @see #getStartQuantity()
* @generated
* @ordered
*/
protected static final int START_QUANTITY_EDEFAULT = 1;
/**
* The cached value of the '{@link #getStartQuantity() Start Quantity}' attribute.
*
*
* @see #getStartQuantity()
* @generated
* @ordered
*/
@GwtTransient
protected int startQuantity = START_QUANTITY_EDEFAULT;
/**
*
*
* @generated
*/
protected ActivityImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.ACTIVITY;
}
/**
*
*
* @generated
*/
@Override
public InputOutputSpecification getIoSpecification() {
return ioSpecification;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetIoSpecification(InputOutputSpecification newIoSpecification,
NotificationChain msgs) {
InputOutputSpecification oldIoSpecification = ioSpecification;
ioSpecification = newIoSpecification;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
Bpmn2Package.ACTIVITY__IO_SPECIFICATION, oldIoSpecification, newIoSpecification);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setIoSpecification(InputOutputSpecification newIoSpecification) {
if (newIoSpecification != ioSpecification) {
NotificationChain msgs = null;
if (ioSpecification != null)
msgs = ((InternalEObject) ioSpecification).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__IO_SPECIFICATION, null, msgs);
if (newIoSpecification != null)
msgs = ((InternalEObject) newIoSpecification).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__IO_SPECIFICATION, null, msgs);
msgs = basicSetIoSpecification(newIoSpecification, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__IO_SPECIFICATION,
newIoSpecification, newIoSpecification));
}
/**
*
*
* @generated
*/
@Override
public EList getBoundaryEventRefs() {
if (boundaryEventRefs == null) {
boundaryEventRefs = new EObjectWithInverseEList(BoundaryEvent.class, this,
Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS, Bpmn2Package.BOUNDARY_EVENT__ATTACHED_TO_REF);
}
return boundaryEventRefs;
}
/**
*
*
* @generated
*/
@Override
public EList getProperties() {
if (properties == null) {
properties = new EObjectContainmentEList(Property.class, this, Bpmn2Package.ACTIVITY__PROPERTIES);
}
return properties;
}
/**
*
*
* @generated
*/
@Override
public EList getDataInputAssociations() {
if (dataInputAssociations == null) {
dataInputAssociations = new EObjectContainmentEList(DataInputAssociation.class, this,
Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS);
}
return dataInputAssociations;
}
/**
*
*
* @generated
*/
@Override
public EList getDataOutputAssociations() {
if (dataOutputAssociations == null) {
dataOutputAssociations = new EObjectContainmentEList(DataOutputAssociation.class,
this, Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS);
}
return dataOutputAssociations;
}
/**
*
*
* @generated
*/
@Override
public EList getResources() {
if (resources == null) {
resources = new EObjectContainmentEList(ResourceRole.class, this,
Bpmn2Package.ACTIVITY__RESOURCES);
}
return resources;
}
/**
*
*
* @generated
*/
@Override
public LoopCharacteristics getLoopCharacteristics() {
return loopCharacteristics;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetLoopCharacteristics(LoopCharacteristics newLoopCharacteristics,
NotificationChain msgs) {
LoopCharacteristics oldLoopCharacteristics = loopCharacteristics;
loopCharacteristics = newLoopCharacteristics;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS, oldLoopCharacteristics, newLoopCharacteristics);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setLoopCharacteristics(LoopCharacteristics newLoopCharacteristics) {
if (newLoopCharacteristics != loopCharacteristics) {
NotificationChain msgs = null;
if (loopCharacteristics != null)
msgs = ((InternalEObject) loopCharacteristics).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS, null, msgs);
if (newLoopCharacteristics != null)
msgs = ((InternalEObject) newLoopCharacteristics).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS, null, msgs);
msgs = basicSetLoopCharacteristics(newLoopCharacteristics, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS,
newLoopCharacteristics, newLoopCharacteristics));
}
/**
*
*
* @generated
*/
@Override
public int getCompletionQuantity() {
return completionQuantity;
}
/**
*
*
* @generated
*/
@Override
public void setCompletionQuantity(int newCompletionQuantity) {
int oldCompletionQuantity = completionQuantity;
completionQuantity = newCompletionQuantity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY,
oldCompletionQuantity, completionQuantity));
}
/**
*
*
* @generated
*/
@Override
public SequenceFlow getDefault() {
return default_;
}
/**
*
*
* @generated
*/
@Override
public void setDefault(SequenceFlow newDefault) {
SequenceFlow oldDefault = default_;
default_ = newDefault;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__DEFAULT, oldDefault,
default_));
}
/**
*
*
* @generated
*/
@Override
public boolean isIsForCompensation() {
return isForCompensation;
}
/**
*
*
* @generated
*/
@Override
public void setIsForCompensation(boolean newIsForCompensation) {
boolean oldIsForCompensation = isForCompensation;
isForCompensation = newIsForCompensation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION,
oldIsForCompensation, isForCompensation));
}
/**
*
*
* @generated
*/
@Override
public int getStartQuantity() {
return startQuantity;
}
/**
*
*
* @generated
*/
@Override
public void setStartQuantity(int newStartQuantity) {
int oldStartQuantity = startQuantity;
startQuantity = newStartQuantity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__START_QUANTITY,
oldStartQuantity, startQuantity));
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS:
return ((InternalEList) (InternalEList>) getBoundaryEventRefs()).basicAdd(otherEnd,
msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Bpmn2Package.ACTIVITY__IO_SPECIFICATION:
return basicSetIoSpecification(null, msgs);
case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS:
return ((InternalEList>) getBoundaryEventRefs()).basicRemove(otherEnd, msgs);
case Bpmn2Package.ACTIVITY__PROPERTIES:
return ((InternalEList>) getProperties()).basicRemove(otherEnd, msgs);
case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS:
return ((InternalEList>) getDataInputAssociations()).basicRemove(otherEnd, msgs);
case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS:
return ((InternalEList>) getDataOutputAssociations()).basicRemove(otherEnd, msgs);
case Bpmn2Package.ACTIVITY__RESOURCES:
return ((InternalEList>) getResources()).basicRemove(otherEnd, msgs);
case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS:
return basicSetLoopCharacteristics(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.ACTIVITY__IO_SPECIFICATION:
return getIoSpecification();
case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS:
return getBoundaryEventRefs();
case Bpmn2Package.ACTIVITY__PROPERTIES:
return getProperties();
case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS:
return getDataInputAssociations();
case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS:
return getDataOutputAssociations();
case Bpmn2Package.ACTIVITY__RESOURCES:
return getResources();
case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS:
return getLoopCharacteristics();
case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY:
return getCompletionQuantity();
case Bpmn2Package.ACTIVITY__DEFAULT:
return getDefault();
case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION:
return isIsForCompensation();
case Bpmn2Package.ACTIVITY__START_QUANTITY:
return getStartQuantity();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.ACTIVITY__IO_SPECIFICATION:
setIoSpecification((InputOutputSpecification) newValue);
return;
case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS:
getBoundaryEventRefs().clear();
getBoundaryEventRefs().addAll((Collection extends BoundaryEvent>) newValue);
return;
case Bpmn2Package.ACTIVITY__PROPERTIES:
getProperties().clear();
getProperties().addAll((Collection extends Property>) newValue);
return;
case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS:
getDataInputAssociations().clear();
getDataInputAssociations().addAll((Collection extends DataInputAssociation>) newValue);
return;
case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS:
getDataOutputAssociations().clear();
getDataOutputAssociations().addAll((Collection extends DataOutputAssociation>) newValue);
return;
case Bpmn2Package.ACTIVITY__RESOURCES:
getResources().clear();
getResources().addAll((Collection extends ResourceRole>) newValue);
return;
case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS:
setLoopCharacteristics((LoopCharacteristics) newValue);
return;
case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY:
setCompletionQuantity((Integer) newValue);
return;
case Bpmn2Package.ACTIVITY__DEFAULT:
setDefault((SequenceFlow) newValue);
return;
case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION:
setIsForCompensation((Boolean) newValue);
return;
case Bpmn2Package.ACTIVITY__START_QUANTITY:
setStartQuantity((Integer) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.ACTIVITY__IO_SPECIFICATION:
setIoSpecification((InputOutputSpecification) null);
return;
case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS:
getBoundaryEventRefs().clear();
return;
case Bpmn2Package.ACTIVITY__PROPERTIES:
getProperties().clear();
return;
case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS:
getDataInputAssociations().clear();
return;
case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS:
getDataOutputAssociations().clear();
return;
case Bpmn2Package.ACTIVITY__RESOURCES:
getResources().clear();
return;
case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS:
setLoopCharacteristics((LoopCharacteristics) null);
return;
case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY:
setCompletionQuantity(COMPLETION_QUANTITY_EDEFAULT);
return;
case Bpmn2Package.ACTIVITY__DEFAULT:
setDefault((SequenceFlow) null);
return;
case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION:
setIsForCompensation(IS_FOR_COMPENSATION_EDEFAULT);
return;
case Bpmn2Package.ACTIVITY__START_QUANTITY:
setStartQuantity(START_QUANTITY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.ACTIVITY__IO_SPECIFICATION:
return ioSpecification != null;
case Bpmn2Package.ACTIVITY__BOUNDARY_EVENT_REFS:
return boundaryEventRefs != null && !boundaryEventRefs.isEmpty();
case Bpmn2Package.ACTIVITY__PROPERTIES:
return properties != null && !properties.isEmpty();
case Bpmn2Package.ACTIVITY__DATA_INPUT_ASSOCIATIONS:
return dataInputAssociations != null && !dataInputAssociations.isEmpty();
case Bpmn2Package.ACTIVITY__DATA_OUTPUT_ASSOCIATIONS:
return dataOutputAssociations != null && !dataOutputAssociations.isEmpty();
case Bpmn2Package.ACTIVITY__RESOURCES:
return resources != null && !resources.isEmpty();
case Bpmn2Package.ACTIVITY__LOOP_CHARACTERISTICS:
return loopCharacteristics != null;
case Bpmn2Package.ACTIVITY__COMPLETION_QUANTITY:
return completionQuantity != COMPLETION_QUANTITY_EDEFAULT;
case Bpmn2Package.ACTIVITY__DEFAULT:
return default_ != null;
case Bpmn2Package.ACTIVITY__IS_FOR_COMPENSATION:
return isForCompensation != IS_FOR_COMPENSATION_EDEFAULT;
case Bpmn2Package.ACTIVITY__START_QUANTITY:
return startQuantity != START_QUANTITY_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (completionQuantity: ");
result.append(completionQuantity);
result.append(", isForCompensation: ");
result.append(isForCompensation);
result.append(", startQuantity: ");
result.append(startQuantity);
result.append(')');
return result.toString();
}
} //ActivityImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy