diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/model/nsd.ecore b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/model/nsd.ecore index 21d01e7525b9a5ff535564be9bf99e99a49e20e3..f44ebef06765003734f1916d4a6c4ad7e123e257 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/model/nsd.ecore +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/model/nsd.ecore @@ -136,6 +136,12 @@ <details key="name" value="tAbbreviations"/> <details key="kind" value="elementOnly"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="uniqueAbbreviation"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="uniqueAbbreviation" value="Tuple {
	message : String = 'There shall not be two Abbreviations elements with same name.',
	status : Boolean = 
			self.abbreviation->isUnique( a : Abbreviation | a.name )
}.status"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="abbreviation" ordered="false" upperBound="-1" eType="#//Abbreviation" unsettable="true" containment="true" resolveProxies="false" eOpposite="#//Abbreviation/abbreviations"> @@ -248,7 +254,7 @@ <details key="constraints" value="uniqueDataObject"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="uniqueDataObject" value="Tuple {
	message : String = 'For an AnyLNClass, there shall not be two DataObject sub-elements with same name.',
	status : Boolean = 
			self.dataObject->isUnique( d : DataObject | d.name )
}.status"/> + <details key="uniqueDataObject" value="Tuple {
	message : String = 'For an AnyLNClass, there shall not be two DataObject sub-elements with same name.',
	status : Boolean = 
			-- TODO: base AbstractLNClass should be taken into account
			-- For this, explicit links have to be created first
			self.dataObject->isUnique( d : DataObject | d.name )
}.status"/> </eAnnotations> <eOperations name="getName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> <eOperations name="getLNClasses" eType="#//LNClasses"/> @@ -484,6 +490,12 @@ <details key="name" value="tCDCs"/> <details key="kind" value="elementOnly"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="uniqueCDC"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="uniqueCDC" value="Tuple {
	message : String = 'Within an NS, there shall not be two CDC sub-elements with same name and (if defined) variant.',
	status : Boolean = 
			-- TODO: DependsOn NS should be taken into account ?
			-- For this, explicit links have to be created first
			-- Then, may be this constraint should be in NS and not in Enumerations ?
			self.cDC->select( c : CDC | c.variant = null )->isUnique( c : CDC | c.name )
	 or self.cDC->select( c : CDC | c.variant <> null )->forAll( c1, c2 : CDC | c1 <> c2 implies c1.name <> c2.name or c1.variant <> c2.variant )
}.status"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="cDC" ordered="false" upperBound="-1" eType="#//CDC" unsettable="true" containment="true" resolveProxies="false" eOpposite="#//CDC/cDCs"> @@ -558,7 +570,7 @@ <details key="constraints" value="uniqueSubDataAttribute"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="uniqueSubDataAttribute" value="Tuple {
	message : String = 'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name',
	status : Boolean = 
			self.subDataAttribute->isUnique( s : SubDataAttribute | s.name )
}.status"/> + <details key="uniqueSubDataAttribute" value="Tuple {
	message : String = 'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name.',
	status : Boolean = 
			self.subDataAttribute->isUnique( s : SubDataAttribute | s.name )
}.status"/> </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="subDataAttribute" ordered="false" upperBound="-1" eType="#//SubDataAttribute" unsettable="true" containment="true" @@ -588,6 +600,12 @@ <details key="name" value="tConstructedAttributes"/> <details key="kind" value="elementOnly"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="uniqueConstructedAttribute"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="uniqueConstructedAttribute" value="Tuple {
	message : String = 'Within an NS, there shall not be two ConstructedAttribute sub-elements with same name.',
	status : Boolean = 
			-- TODO: DependsOn NS should be taken into account ?
			-- For this, explicit links have to be created first
			-- Then, may be this constraint should be in NS and not in Enumerations ?
			self.constructedAttribute->isUnique( c : ConstructedAttribute | c.name )
}.status"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="constructedAttribute" ordered="false" upperBound="-1" eType="#//ConstructedAttribute" unsettable="true" containment="true" resolveProxies="false" eOpposite="#//ConstructedAttribute/constructedAttributes"> @@ -886,6 +904,12 @@ <details key="name" value="tEnumerations"/> <details key="kind" value="elementOnly"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="uniqueEnumeration"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="uniqueEnumeration" value="Tuple {
	message : String = 'Within an NS, there shall not be two Enumeration sub-elements with same name.',
	status : Boolean = 
			-- TODO: DependsOn NS should be taken into account ?
			-- For this, explicit links have to be created first
			-- Then, may be this constraint should be in NS and not in Enumerations ?
			self.enumeration->isUnique( e : Enumeration | e.name )
}.status"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="enumeration" upperBound="-1" eType="#//Enumeration" unsettable="true" containment="true" resolveProxies="false" eOpposite="#//Enumeration/enumerations"> @@ -1068,6 +1092,13 @@ <details key="name" value="tLNClasses"/> <details key="kind" value="elementOnly"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="uniqueAbstractLNClass uniqueLNClass"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="uniqueAbstractLNClass" value="Tuple {
	message : String = 'Within an NS, there shall not be two AbstractLNClass sub-elements with same name.',
	status : Boolean = 
			self.abstractLNClass->isUnique( c : AbstractLNClass | c.name )
}.status"/> + <details key="uniqueLNClass" value="Tuple {
	message : String = 'Within an NS, there shall not be two LNClass sub-elements with same name.',
	status : Boolean = 
			self.lNClass->isUnique( c : LNClass | c.name )
}.status"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="abstractLNClass" ordered="false" upperBound="-1" eType="#//AbstractLNClass" unsettable="true" containment="true" resolveProxies="false" eOpposite="#//AbstractLNClass/lNClasses"> @@ -1298,6 +1329,12 @@ <details key="name" value="tPresenceConditions"/> <details key="kind" value="elementOnly"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="uniquePresenceCondition"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="uniquePresenceCondition" value="Tuple {
	message : String = 'There shall not be two PresenceCondition elements with same name.',
	status : Boolean = 
			self.presenceCondition->isUnique( p : PresenceCondition | p.name )
}.status"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="presenceCondition" ordered="false" upperBound="-1" eType="#//PresenceCondition" unsettable="true" containment="true" resolveProxies="false" eOpposite="#//PresenceCondition/presenceConditions"> diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Abbreviations.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Abbreviations.java index 2999912a0ad96ae22d2095d0c9cac26c694d1f99..bd2d91b0eefdfcebb70dd513c78da833d92e09ce 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Abbreviations.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Abbreviations.java @@ -37,6 +37,8 @@ import org.eclipse.emf.common.util.EList; * * @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getAbbreviations() * @model extendedMetaData="name='tAbbreviations' kind='elementOnly'" + * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueAbbreviation'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueAbbreviation='Tuple {\n\tmessage : String = \'There shall not be two Abbreviations elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.abbreviation->isUnique( a : Abbreviation | a.name )\n}.status'" * @generated */ public interface Abbreviations extends NsdObject { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/AnyLNClass.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/AnyLNClass.java index 94db09f62486eb85fa6402523d91386438df6f79..e9a7e3d4ed5bb9ce9c65890dddeff57e3eb7c358 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/AnyLNClass.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/AnyLNClass.java @@ -39,7 +39,7 @@ import org.eclipse.emf.common.util.EList; * @model abstract="true" * extendedMetaData="name='tAnyLNClass' kind='elementOnly'" * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueDataObject'" - * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueDataObject='Tuple {\n\tmessage : String = \'For an AnyLNClass, there shall not be two DataObject sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.dataObject->isUnique( d : DataObject | d.name )\n}.status'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueDataObject='Tuple {\n\tmessage : String = \'For an AnyLNClass, there shall not be two DataObject sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: base AbstractLNClass should be taken into account\n\t\t\t-- For this, explicit links have to be created first\n\t\t\tself.dataObject->isUnique( d : DataObject | d.name )\n}.status'" * @generated */ public interface AnyLNClass extends TitledClass { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/CDCs.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/CDCs.java index cf27f947bde3eac96a07c06d38804742ec519358..eb996b385a48894c9f681583cfaa2b913fc648a1 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/CDCs.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/CDCs.java @@ -36,6 +36,8 @@ import org.eclipse.emf.common.util.EList; * * @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getCDCs() * @model extendedMetaData="name='tCDCs' kind='elementOnly'" + * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueCDC'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueCDC='Tuple {\n\tmessage : String = \'Within an NS, there shall not be two CDC sub-elements with same name and (if defined) variant.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: DependsOn NS should be taken into account ?\n\t\t\t-- For this, explicit links have to be created first\n\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n\t\t\tself.cDC->select( c : CDC | c.variant = null )->isUnique( c : CDC | c.name )\n\t or self.cDC->select( c : CDC | c.variant <> null )->forAll( c1, c2 : CDC | c1 <> c2 implies c1.name <> c2.name or c1.variant <> c2.variant )\n}.status'" * @generated */ public interface CDCs extends NsdObject { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttribute.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttribute.java index 3b9576a057aeb521c121c1f7a12d4ec6de64630d..2a778874f6c042518eb20561d25af8b06096863b 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttribute.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttribute.java @@ -39,7 +39,7 @@ import org.eclipse.emf.common.util.EList; * @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getConstructedAttribute() * @model extendedMetaData="name='tConstructedAttribute' kind='elementOnly'" * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueSubDataAttribute'" - * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueSubDataAttribute='Tuple {\n\tmessage : String = \'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name\',\n\tstatus : Boolean = \n\t\t\tself.subDataAttribute->isUnique( s : SubDataAttribute | s.name )\n}.status'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueSubDataAttribute='Tuple {\n\tmessage : String = \'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.subDataAttribute->isUnique( s : SubDataAttribute | s.name )\n}.status'" * @generated */ public interface ConstructedAttribute extends TitledClass { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttributes.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttributes.java index 1d8f6540e605e1d0aa2c211a80f4cefdec3ec7ed..b68b7a1da9ac0008b5d9b0c8f814fbf570da97aa 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttributes.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/ConstructedAttributes.java @@ -36,6 +36,8 @@ import org.eclipse.emf.common.util.EList; * * @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getConstructedAttributes() * @model extendedMetaData="name='tConstructedAttributes' kind='elementOnly'" + * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueConstructedAttribute'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueConstructedAttribute='Tuple {\n\tmessage : String = \'Within an NS, there shall not be two ConstructedAttribute sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: DependsOn NS should be taken into account ?\n\t\t\t-- For this, explicit links have to be created first\n\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n\t\t\tself.constructedAttribute->isUnique( c : ConstructedAttribute | c.name )\n}.status'" * @generated */ public interface ConstructedAttributes extends NsdObject { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Enumerations.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Enumerations.java index 040d61339d41f6aef66d3e59f4b16d2477b7908e..f9d5811176dab54afaa962b4e10a0d770dd31cac 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Enumerations.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/Enumerations.java @@ -36,6 +36,8 @@ import org.eclipse.emf.common.util.EList; * * @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getEnumerations() * @model extendedMetaData="name='tEnumerations' kind='elementOnly'" + * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueEnumeration'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueEnumeration='Tuple {\n\tmessage : String = \'Within an NS, there shall not be two Enumeration sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: DependsOn NS should be taken into account ?\n\t\t\t-- For this, explicit links have to be created first\n\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n\t\t\tself.enumeration->isUnique( e : Enumeration | e.name )\n}.status'" * @generated */ public interface Enumerations extends NsdObject { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/LNClasses.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/LNClasses.java index a5b2fb850d48f90831011e41b2b0b2fc3e301070..7abdfac2a8499eed46519791e4f523fb58efa0fc 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/LNClasses.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/LNClasses.java @@ -37,6 +37,8 @@ import org.eclipse.emf.common.util.EList; * * @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getLNClasses() * @model extendedMetaData="name='tLNClasses' kind='elementOnly'" + * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueAbstractLNClass uniqueLNClass'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniqueAbstractLNClass='Tuple {\n\tmessage : String = \'Within an NS, there shall not be two AbstractLNClass sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.abstractLNClass->isUnique( c : AbstractLNClass | c.name )\n}.status' uniqueLNClass='Tuple {\n\tmessage : String = \'Within an NS, there shall not be two LNClass sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.lNClass->isUnique( c : LNClass | c.name )\n}.status'" * @generated */ public interface LNClasses extends NsdObject { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/PresenceConditions.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/PresenceConditions.java index ea010d2b96a36477b72ef4c870942ffe759609c4..a0b5819a315f410bb449bfe61615b546e4850c90 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/PresenceConditions.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/PresenceConditions.java @@ -37,6 +37,8 @@ import org.eclipse.emf.common.util.EList; * * @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getPresenceConditions() * @model extendedMetaData="name='tPresenceConditions' kind='elementOnly'" + * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniquePresenceCondition'" + * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot uniquePresenceCondition='Tuple {\n\tmessage : String = \'There shall not be two PresenceCondition elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.presenceCondition->isUnique( p : PresenceCondition | p.name )\n}.status'" * @generated */ public interface PresenceConditions extends NsdObject { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/impl/NsdPackageImpl.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/impl/NsdPackageImpl.java index 56004cf1e0e6f670fc84ae9acaa0d5fe3f003a1f..21b48d74b16c9d41bc6163f34258c353707fff6f 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/impl/NsdPackageImpl.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/impl/NsdPackageImpl.java @@ -5252,15 +5252,22 @@ public class NsdPackageImpl extends EPackageImpl implements NsdPackage { new String[] { "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "validationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot" } ); + addAnnotation( abbreviationsEClass, source, new String[] { "constraints", "uniqueAbbreviation" } ); addAnnotation( anyLNClassEClass, source, new String[] { "constraints", "uniqueDataObject" } ); addAnnotation( applicableServicesEClass, source, new String[] { "constraints", "uniqueDataSetMemberOf uniqueService" } ); addAnnotation( cdcEClass, source, new String[] { "constraints", "uniqueCDCChild" } ); + addAnnotation( cdCsEClass, source, new String[] { "constraints", "uniqueCDC" } ); addAnnotation( constructedAttributeEClass, source, new String[] { "constraints", "uniqueSubDataAttribute" } ); + addAnnotation( constructedAttributesEClass, source, + new String[] { "constraints", "uniqueConstructedAttribute" } ); addAnnotation( enumerationEClass, source, new String[] { "constraints", "uniqueLiteralName uniqueLiteralVal" } ); + addAnnotation( enumerationsEClass, source, new String[] { "constraints", "uniqueEnumeration" } ); addAnnotation( functionalConstraintsEClass, source, new String[] { "constraints", "uniqueFunctionalConstraint" } ); + addAnnotation( lnClassesEClass, source, new String[] { "constraints", "uniqueAbstractLNClass uniqueLNClass" } ); + addAnnotation( presenceConditionsEClass, source, new String[] { "constraints", "uniquePresenceCondition" } ); } /** @@ -5591,22 +5598,36 @@ public class NsdPackageImpl extends EPackageImpl implements NsdPackage { */ protected void createPivotAnnotations() { String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"; + addAnnotation( abbreviationsEClass, source, new String[] { "uniqueAbbreviation", + "Tuple {\n\tmessage : String = \'There shall not be two Abbreviations elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.abbreviation->isUnique( a : Abbreviation | a.name )\n}.status" } ); addAnnotation( anyLNClassEClass, source, new String[] { "uniqueDataObject", - "Tuple {\n\tmessage : String = \'For an AnyLNClass, there shall not be two DataObject sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.dataObject->isUnique( d : DataObject | d.name )\n}.status" } ); + "Tuple {\n\tmessage : String = \'For an AnyLNClass, there shall not be two DataObject sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: base AbstractLNClass should be taken into account\n\t\t\t-- For this, explicit links have to be created first\n\t\t\tself.dataObject->isUnique( d : DataObject | d.name )\n}.status" } ); addAnnotation( applicableServicesEClass, source, new String[] { "uniqueDataSetMemberOf", "Tuple {\n\tmessage : String = \'For an ApplicableServices, there shall not be two DataSetMemberOf sub-elements with same cb.\',\n\tstatus : Boolean = \n\t\t\tself.dataSetMemberOf->isUnique( d : DataSetMemberOf | d.cb )\n}.status", "uniqueService", "Tuple {\n\tmessage : String = \'For an ApplicableServices, there shall not be two ServiceType sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.service->isUnique( s : ServiceType | s.name )\n}.status" } ); addAnnotation( cdcEClass, source, new String[] { "uniqueCDCChild", "Tuple {\n\tmessage : String = \'For a CDC, there shall not be two sub-elements (SubDataObject or DataAttribute) with same name.\',\n\tstatus : Boolean = \n\t\t\tlet names : Bag(String) = self.subDataObject.name->union(self.dataAttribute.name) in names->size() = names->asSet()->size()\n}.status" } ); + addAnnotation( cdCsEClass, source, new String[] { "uniqueCDC", + "Tuple {\n\tmessage : String = \'Within an NS, there shall not be two CDC sub-elements with same name and (if defined) variant.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: DependsOn NS should be taken into account ?\n\t\t\t-- For this, explicit links have to be created first\n\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n\t\t\tself.cDC->select( c : CDC | c.variant = null )->isUnique( c : CDC | c.name )\n\t or self.cDC->select( c : CDC | c.variant <> null )->forAll( c1, c2 : CDC | c1 <> c2 implies c1.name <> c2.name or c1.variant <> c2.variant )\n}.status" } ); addAnnotation( constructedAttributeEClass, source, new String[] { "uniqueSubDataAttribute", - "Tuple {\n\tmessage : String = \'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name\',\n\tstatus : Boolean = \n\t\t\tself.subDataAttribute->isUnique( s : SubDataAttribute | s.name )\n}.status" } ); + "Tuple {\n\tmessage : String = \'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.subDataAttribute->isUnique( s : SubDataAttribute | s.name )\n}.status" } ); + addAnnotation( constructedAttributesEClass, source, new String[] { "uniqueConstructedAttribute", + "Tuple {\n\tmessage : String = \'Within an NS, there shall not be two ConstructedAttribute sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: DependsOn NS should be taken into account ?\n\t\t\t-- For this, explicit links have to be created first\n\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n\t\t\tself.constructedAttribute->isUnique( c : ConstructedAttribute | c.name )\n}.status" } ); addAnnotation( enumerationEClass, source, new String[] { "uniqueLiteralName", "Tuple {\n\tmessage : String = \'For an Enumeration, there shall not be two Literal sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: inherited literals should be taken into account\n\t\t\t-- For this, explicit links have to be created first\n\t\t\tself.literal->isUnique( l : Literal | l.name )\n}.status", "uniqueLiteralVal", "Tuple {\n\tmessage : String = \'For an Enumeration, there shall not be two Literal sub-elements with same literalVal.\',\n\tstatus : Boolean = \n\t\t\tself.literal->isUnique( l : Literal | l.literalVal )\n}.status" } ); + addAnnotation( enumerationsEClass, source, new String[] { "uniqueEnumeration", + "Tuple {\n\tmessage : String = \'Within an NS, there shall not be two Enumeration sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\t-- TODO: DependsOn NS should be taken into account ?\n\t\t\t-- For this, explicit links have to be created first\n\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n\t\t\tself.enumeration->isUnique( e : Enumeration | e.name )\n}.status" } ); addAnnotation( functionalConstraintsEClass, source, new String[] { "uniqueFunctionalConstraint", "Tuple {\n\tmessage : String = \'There shall not be two FunctionalConstraint elements with same abbreviation.\',\n\tstatus : Boolean = \n\t\t\tself.functionalConstraint->isUnique( f : FunctionalConstraint | f.abbreviation )\n}.status" } ); + addAnnotation( lnClassesEClass, source, new String[] { "uniqueAbstractLNClass", + "Tuple {\n\tmessage : String = \'Within an NS, there shall not be two AbstractLNClass sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.abstractLNClass->isUnique( c : AbstractLNClass | c.name )\n}.status", + "uniqueLNClass", + "Tuple {\n\tmessage : String = \'Within an NS, there shall not be two LNClass sub-elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.lNClass->isUnique( c : LNClass | c.name )\n}.status" } ); + addAnnotation( presenceConditionsEClass, source, new String[] { "uniquePresenceCondition", + "Tuple {\n\tmessage : String = \'There shall not be two PresenceCondition elements with same name.\',\n\tstatus : Boolean = \n\t\t\tself.presenceCondition->isUnique( p : PresenceCondition | p.name )\n}.status" } ); } } //NsdPackageImpl diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdResourceSetImpl.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdResourceSetImpl.java index 21395b008bf264f34e6c892d1a2801a806a8c858..be4362b9b813db958d87aa1f22eb67c9ad5aff53 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdResourceSetImpl.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdResourceSetImpl.java @@ -64,7 +64,7 @@ public class NsdResourceSetImpl extends ResourceSetImpl { } NS ns = ( NS ) root.getNS(); if( nsdResources.get( ns.getId() ) != null ) { - AbstractRiseClipseConsole.getConsole().error( "There is already an NSD file with is " + ns.getId() + ", " + resource.getURI() + "is ignored" ); + AbstractRiseClipseConsole.getConsole().error( "There is already an NSD file with is " + ns.getId() + ", " + resource.getURI() + " is ignored" ); this.getResources().remove( resource ); return; } @@ -123,23 +123,35 @@ public class NsdResourceSetImpl extends ResourceSetImpl { * NS/PresenceConditions: * Name: uniquePresenceCondition Selector: nsd:PresenceCondition Field: @name * There shall not be two PresenceCondition elements with same name. + * DONE + * * NS/Abbreviations: * Name: uniqueAbbreviation Selector: nsd:Abbreviation Field: @name * There shall not be two Abbreviations elements with same name. + * DONE + * * NS/Enumerations: * Name: uniqueEnumeration Selector: nsd:Enumeration Field: @name * Within an NS, there shall not be two Enumeration sub-elements with same name. + * DONE + * * NS/ConstructedAttributes * Name: uniqueConstructedAttribute Selector: nsd:ConstructedAttribute Field: @name * Within an NS, there shall not be two ConstructedAttribute sub-elements with same name. + * DONE + * * NS/CDCs: * Name: uniqueCDC Selector: nsd:CDC Field: @name @variant * Within an NS, there shall not be two CDC sub-elements with same name and (if defined) variant. + * DONE + * * NS/LNClasses: * Name: uniqueAbstractLNClass Selector: nsd:AbstractLNClass Field: @name * Within an NS, there shall not be two AbstractLNClass sub-elements with same name. * Name: uniqueLNClass Selector: nsd:LNClass Field: @name * Within an NS, there shall not be two LNClass sub-elements with same name. + * DONE + * * ServiceCDCs/ServiceCDC: * Name: uniqueServiceCDCChild Selector: nsd:ServiceDataAttribute Field: @name * For a CDC, there shall not be two ServiceDataAttribute sub-elements with same name. diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdValidator.java b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdValidator.java index 07b0f147b45daac7a2b932e11fa4c2412ec3329d..13993e8d789d1a4026e99e34c76e5f455dff9ba0 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdValidator.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.nsd/src/fr/centralesupelec/edf/riseclipse/iec61850/nsd/util/NsdValidator.java @@ -320,7 +320,47 @@ public class NsdValidator extends EObjectValidator { */ public boolean validateAbbreviations( Abbreviations abbreviations, DiagnosticChain diagnostics, Map< Object, Object > context ) { - return validate_EveryDefaultConstraint( abbreviations, diagnostics, context ); + if( !validate_NoCircularContainment( abbreviations, diagnostics, context ) ) return false; + boolean result = validate_EveryMultiplicityConforms( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryDataValueConforms( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryReferenceIsContained( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryBidirectionalReferenceIsPaired( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryProxyResolves( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_UniqueID( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryKeyUnique( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryMapEntryUnique( abbreviations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validateAbbreviations_uniqueAbbreviation( abbreviations, diagnostics, context ); + return result; + } + + /** + * The cached validation expression for the uniqueAbbreviation constraint of '<em>Abbreviations</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static final String ABBREVIATIONS__UNIQUE_ABBREVIATION__EEXPRESSION = "Tuple {\n" + + "\tmessage : String = 'There shall not be two Abbreviations elements with same name.',\n" + + "\tstatus : Boolean = \n" + "\t\t\tself.abbreviation->isUnique( a : Abbreviation | a.name )\n" + + "}.status"; + + /** + * Validates the uniqueAbbreviation constraint of '<em>Abbreviations</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateAbbreviations_uniqueAbbreviation( Abbreviations abbreviations, DiagnosticChain diagnostics, + Map< Object, Object > context ) { + return validate( NsdPackage.Literals.ABBREVIATIONS, abbreviations, diagnostics, context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniqueAbbreviation", + ABBREVIATIONS__UNIQUE_ABBREVIATION__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0 ); } /** @@ -381,7 +421,9 @@ public class NsdValidator extends EObjectValidator { */ protected static final String ANY_LN_CLASS__UNIQUE_DATA_OBJECT__EEXPRESSION = "Tuple {\n" + "\tmessage : String = 'For an AnyLNClass, there shall not be two DataObject sub-elements with same name.',\n" - + "\tstatus : Boolean = \n" + "\t\t\tself.dataObject->isUnique( d : DataObject | d.name )\n" + "}.status"; + + "\tstatus : Boolean = \n" + "\t\t\t-- TODO: base AbstractLNClass should be taken into account\n" + + "\t\t\t-- For this, explicit links have to be created first\n" + + "\t\t\tself.dataObject->isUnique( d : DataObject | d.name )\n" + "}.status"; /** * Validates the uniqueDataObject constraint of '<em>Any LN Class</em>'. @@ -552,7 +594,45 @@ public class NsdValidator extends EObjectValidator { * @generated */ public boolean validateCDCs( CDCs cdCs, DiagnosticChain diagnostics, Map< Object, Object > context ) { - return validate_EveryDefaultConstraint( cdCs, diagnostics, context ); + if( !validate_NoCircularContainment( cdCs, diagnostics, context ) ) return false; + boolean result = validate_EveryMultiplicityConforms( cdCs, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryDataValueConforms( cdCs, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryReferenceIsContained( cdCs, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryBidirectionalReferenceIsPaired( cdCs, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryProxyResolves( cdCs, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_UniqueID( cdCs, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryKeyUnique( cdCs, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryMapEntryUnique( cdCs, diagnostics, context ); + if( result || diagnostics != null ) result &= validateCDCs_uniqueCDC( cdCs, diagnostics, context ); + return result; + } + + /** + * The cached validation expression for the uniqueCDC constraint of '<em>CD Cs</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static final String CD_CS__UNIQUE_CDC__EEXPRESSION = "Tuple {\n" + + "\tmessage : String = 'Within an NS, there shall not be two CDC sub-elements with same name and (if defined) variant.',\n" + + "\tstatus : Boolean = \n" + "\t\t\t-- TODO: DependsOn NS should be taken into account ?\n" + + "\t\t\t-- For this, explicit links have to be created first\n" + + "\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n" + + "\t\t\tself.cDC->select( c : CDC | c.variant = null )->isUnique( c : CDC | c.name )\n" + + "\t or self.cDC->select( c : CDC | c.variant <> null )->forAll( c1, c2 : CDC | c1 <> c2 implies c1.name <> c2.name or c1.variant <> c2.variant )\n" + + "}.status"; + + /** + * Validates the uniqueCDC constraint of '<em>CD Cs</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateCDCs_uniqueCDC( CDCs cdCs, DiagnosticChain diagnostics, Map< Object, Object > context ) { + return validate( NsdPackage.Literals.CD_CS, cdCs, diagnostics, context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniqueCDC", CD_CS__UNIQUE_CDC__EEXPRESSION, + Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0 ); } /** @@ -598,7 +678,7 @@ public class NsdValidator extends EObjectValidator { * @generated */ protected static final String CONSTRUCTED_ATTRIBUTE__UNIQUE_SUB_DATA_ATTRIBUTE__EEXPRESSION = "Tuple {\n" - + "\tmessage : String = 'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name',\n" + + "\tmessage : String = 'For a ConstructedAttribute, there shall not be two SubDataAttribute sub-elements with same name.',\n" + "\tstatus : Boolean = \n" + "\t\t\tself.subDataAttribute->isUnique( s : SubDataAttribute | s.name )\n" + "}.status"; @@ -622,7 +702,52 @@ public class NsdValidator extends EObjectValidator { */ public boolean validateConstructedAttributes( ConstructedAttributes constructedAttributes, DiagnosticChain diagnostics, Map< Object, Object > context ) { - return validate_EveryDefaultConstraint( constructedAttributes, diagnostics, context ); + if( !validate_NoCircularContainment( constructedAttributes, diagnostics, context ) ) return false; + boolean result = validate_EveryMultiplicityConforms( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryDataValueConforms( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryReferenceIsContained( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryBidirectionalReferenceIsPaired( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryProxyResolves( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_UniqueID( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryKeyUnique( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryMapEntryUnique( constructedAttributes, diagnostics, context ); + if( result || diagnostics != null ) + result &= validateConstructedAttributes_uniqueConstructedAttribute( constructedAttributes, diagnostics, + context ); + return result; + } + + /** + * The cached validation expression for the uniqueConstructedAttribute constraint of '<em>Constructed Attributes</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static final String CONSTRUCTED_ATTRIBUTES__UNIQUE_CONSTRUCTED_ATTRIBUTE__EEXPRESSION = "Tuple {\n" + + "\tmessage : String = 'Within an NS, there shall not be two ConstructedAttribute sub-elements with same name.',\n" + + "\tstatus : Boolean = \n" + "\t\t\t-- TODO: DependsOn NS should be taken into account ?\n" + + "\t\t\t-- For this, explicit links have to be created first\n" + + "\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n" + + "\t\t\tself.constructedAttribute->isUnique( c : ConstructedAttribute | c.name )\n" + "}.status"; + + /** + * Validates the uniqueConstructedAttribute constraint of '<em>Constructed Attributes</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateConstructedAttributes_uniqueConstructedAttribute( + ConstructedAttributes constructedAttributes, DiagnosticChain diagnostics, Map< Object, Object > context ) { + return validate( NsdPackage.Literals.CONSTRUCTED_ATTRIBUTES, constructedAttributes, diagnostics, context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniqueConstructedAttribute", + CONSTRUCTED_ATTRIBUTES__UNIQUE_CONSTRUCTED_ATTRIBUTE__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, + 0 ); } /** @@ -775,7 +900,48 @@ public class NsdValidator extends EObjectValidator { */ public boolean validateEnumerations( Enumerations enumerations, DiagnosticChain diagnostics, Map< Object, Object > context ) { - return validate_EveryDefaultConstraint( enumerations, diagnostics, context ); + if( !validate_NoCircularContainment( enumerations, diagnostics, context ) ) return false; + boolean result = validate_EveryMultiplicityConforms( enumerations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryDataValueConforms( enumerations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryReferenceIsContained( enumerations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryBidirectionalReferenceIsPaired( enumerations, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryProxyResolves( enumerations, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_UniqueID( enumerations, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryKeyUnique( enumerations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryMapEntryUnique( enumerations, diagnostics, context ); + if( result || diagnostics != null ) + result &= validateEnumerations_uniqueEnumeration( enumerations, diagnostics, context ); + return result; + } + + /** + * The cached validation expression for the uniqueEnumeration constraint of '<em>Enumerations</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static final String ENUMERATIONS__UNIQUE_ENUMERATION__EEXPRESSION = "Tuple {\n" + + "\tmessage : String = 'Within an NS, there shall not be two Enumeration sub-elements with same name.',\n" + + "\tstatus : Boolean = \n" + "\t\t\t-- TODO: DependsOn NS should be taken into account ?\n" + + "\t\t\t-- For this, explicit links have to be created first\n" + + "\t\t\t-- Then, may be this constraint should be in NS and not in Enumerations ?\n" + + "\t\t\tself.enumeration->isUnique( e : Enumeration | e.name )\n" + "}.status"; + + /** + * Validates the uniqueEnumeration constraint of '<em>Enumerations</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateEnumerations_uniqueEnumeration( Enumerations enumerations, DiagnosticChain diagnostics, + Map< Object, Object > context ) { + return validate( NsdPackage.Literals.ENUMERATIONS, enumerations, diagnostics, context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniqueEnumeration", + ENUMERATIONS__UNIQUE_ENUMERATION__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0 ); } /** @@ -888,7 +1054,70 @@ public class NsdValidator extends EObjectValidator { */ public boolean validateLNClasses( LNClasses lnClasses, DiagnosticChain diagnostics, Map< Object, Object > context ) { - return validate_EveryDefaultConstraint( lnClasses, diagnostics, context ); + if( !validate_NoCircularContainment( lnClasses, diagnostics, context ) ) return false; + boolean result = validate_EveryMultiplicityConforms( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryDataValueConforms( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryReferenceIsContained( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryBidirectionalReferenceIsPaired( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryProxyResolves( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_UniqueID( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryKeyUnique( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_EveryMapEntryUnique( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) + result &= validateLNClasses_uniqueAbstractLNClass( lnClasses, diagnostics, context ); + if( result || diagnostics != null ) + result &= validateLNClasses_uniqueLNClass( lnClasses, diagnostics, context ); + return result; + } + + /** + * The cached validation expression for the uniqueAbstractLNClass constraint of '<em>LN Classes</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static final String LN_CLASSES__UNIQUE_ABSTRACT_LN_CLASS__EEXPRESSION = "Tuple {\n" + + "\tmessage : String = 'Within an NS, there shall not be two AbstractLNClass sub-elements with same name.',\n" + + "\tstatus : Boolean = \n" + "\t\t\tself.abstractLNClass->isUnique( c : AbstractLNClass | c.name )\n" + + "}.status"; + + /** + * Validates the uniqueAbstractLNClass constraint of '<em>LN Classes</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateLNClasses_uniqueAbstractLNClass( LNClasses lnClasses, DiagnosticChain diagnostics, + Map< Object, Object > context ) { + return validate( NsdPackage.Literals.LN_CLASSES, lnClasses, diagnostics, context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniqueAbstractLNClass", + LN_CLASSES__UNIQUE_ABSTRACT_LN_CLASS__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0 ); + } + + /** + * The cached validation expression for the uniqueLNClass constraint of '<em>LN Classes</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static final String LN_CLASSES__UNIQUE_LN_CLASS__EEXPRESSION = "Tuple {\n" + + "\tmessage : String = 'Within an NS, there shall not be two LNClass sub-elements with same name.',\n" + + "\tstatus : Boolean = \n" + "\t\t\tself.lNClass->isUnique( c : LNClass | c.name )\n" + "}.status"; + + /** + * Validates the uniqueLNClass constraint of '<em>LN Classes</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateLNClasses_uniqueLNClass( LNClasses lnClasses, DiagnosticChain diagnostics, + Map< Object, Object > context ) { + return validate( NsdPackage.Literals.LN_CLASSES, lnClasses, diagnostics, context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniqueLNClass", + LN_CLASSES__UNIQUE_LN_CLASS__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0 ); } /** @@ -935,7 +1164,48 @@ public class NsdValidator extends EObjectValidator { */ public boolean validatePresenceConditions( PresenceConditions presenceConditions, DiagnosticChain diagnostics, Map< Object, Object > context ) { - return validate_EveryDefaultConstraint( presenceConditions, diagnostics, context ); + if( !validate_NoCircularContainment( presenceConditions, diagnostics, context ) ) return false; + boolean result = validate_EveryMultiplicityConforms( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryDataValueConforms( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryReferenceIsContained( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryBidirectionalReferenceIsPaired( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryProxyResolves( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) result &= validate_UniqueID( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryKeyUnique( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) + result &= validate_EveryMapEntryUnique( presenceConditions, diagnostics, context ); + if( result || diagnostics != null ) + result &= validatePresenceConditions_uniquePresenceCondition( presenceConditions, diagnostics, context ); + return result; + } + + /** + * The cached validation expression for the uniquePresenceCondition constraint of '<em>Presence Conditions</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static final String PRESENCE_CONDITIONS__UNIQUE_PRESENCE_CONDITION__EEXPRESSION = "Tuple {\n" + + "\tmessage : String = 'There shall not be two PresenceCondition elements with same name.',\n" + + "\tstatus : Boolean = \n" + "\t\t\tself.presenceCondition->isUnique( p : PresenceCondition | p.name )\n" + + "}.status"; + + /** + * Validates the uniquePresenceCondition constraint of '<em>Presence Conditions</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validatePresenceConditions_uniquePresenceCondition( PresenceConditions presenceConditions, + DiagnosticChain diagnostics, Map< Object, Object > context ) { + return validate( NsdPackage.Literals.PRESENCE_CONDITIONS, presenceConditions, diagnostics, context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniquePresenceCondition", + PRESENCE_CONDITIONS__UNIQUE_PRESENCE_CONDITION__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0 ); } /**