Skip to content
Snippets Groups Projects
Commit 2b0122b5 authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

added required attributes as OCLinEcore constraints

parent 1ed977fc
No related branches found
No related tags found
1 merge request!3Resolve "Expose implicit links between NSD objects"
Showing
with 187 additions and 9 deletions
......@@ -35,6 +35,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getAbbreviation()
* @model extendedMetaData="name='tAbbreviation' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface Abbreviation extends NsdObject {
......
......@@ -37,6 +37,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getAbstractLNClass()
* @model extendedMetaData="name='tAbstractLNClass' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface AbstractLNClass extends AnyLNClass {
......@@ -53,6 +55,7 @@ public interface AbstractLNClass extends AnyLNClass {
* extendedMetaData="kind='attribute' name='name'"
* @generated
*/
@Override
String getName();
/**
......@@ -106,6 +109,7 @@ public interface AbstractLNClass extends AnyLNClass {
* @model opposite="abstractLNClass" resolveProxies="false" unsettable="true" ordered="false"
* @generated
*/
@Override
LNClasses getLNClasses();
/**
......
......@@ -39,6 +39,8 @@ import org.eclipse.emf.ecore.EObject;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getAgNSIdentification()
* @model abstract="true"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='idAttributeRequired versionAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot idAttributeRequired='Tuple {\n\tmessage : String = \'The id attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.id <> null\n}.status' versionAttributeRequired='Tuple {\n\tmessage : String = \'The version attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.version <> null\n}.status'"
* @generated
*/
public interface AgNSIdentification extends EObject {
......
......@@ -39,6 +39,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getApplicableServiceNS()
* @model extendedMetaData="name='tApplicableServiceNS' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='versionAttributeRequired dateAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot versionAttributeRequired='Tuple {\n\tmessage : String = \'The version attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.version <> null\n}.status' dateAttributeRequired='Tuple {\n\tmessage : String = \'The date attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.date <> null\n}.status'"
* @generated
*/
public interface ApplicableServiceNS extends Copyrighted {
......
......@@ -35,6 +35,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getBasicType()
* @model extendedMetaData="name='tBasicType' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface BasicType extends NsdObject {
......
......@@ -45,8 +45,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getCDC()
* @model extendedMetaData="name='tCDC' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueCDCChild'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot 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'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueCDCChild nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot 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' nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface CDC extends TitledClass {
......
......@@ -42,6 +42,8 @@ import javax.xml.datatype.XMLGregorianCalendar;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getChanges()
* @model extendedMetaData="name='tChanges' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='versionAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot versionAttributeRequired='Tuple {\n\tmessage : String = \'The version attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.version <> null\n}.status'"
* @generated
*/
public interface Changes extends NsdObject {
......
......@@ -38,8 +38,8 @@ 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 constraints='uniqueSubDataAttribute nameAttributeRequired'"
* 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' nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface ConstructedAttribute extends TitledClass {
......
......@@ -45,6 +45,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getDataAttribute()
* @model extendedMetaData="name='tDataAttribute' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired fcAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status' fcAttributeRequired='Tuple {\n\tmessage : String = \'The fc attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.fc <> null\n}.status'"
* @generated
*/
public interface DataAttribute
......
......@@ -39,6 +39,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getDataObject()
* @model extendedMetaData="name='tDataObject' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired typeAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status' typeAttributeRequired='Tuple {\n\tmessage : String = \'The type attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.type <> null\n}.status'"
* @generated
*/
public interface DataObject
......
......@@ -34,6 +34,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getDataSetMemberOf()
* @model extendedMetaData="name='tDataSetMemberOf' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='cbAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot cbAttributeRequired='Tuple {\n\tmessage : String = \'The cb attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.cb <> null\n}.status'"
* @generated
*/
public interface DataSetMemberOf extends NsdObject {
......
......@@ -39,6 +39,8 @@ import org.eclipse.emf.ecore.util.FeatureMap;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getDoc()
* @model extendedMetaData="name='tDoc' kind='mixed'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='idAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot idAttributeRequired='Tuple {\n\tmessage : String = \'The id attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.id <> null\n}.status'"
* @generated
*/
public interface Doc extends NsdObject {
......
......@@ -40,8 +40,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getEnumeration()
* @model extendedMetaData="name='tEnumeration' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueLiteralName uniqueLiteralVal'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot 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'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='uniqueLiteralName uniqueLiteralVal nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot 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' nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface Enumeration extends TitledClass {
......
......@@ -40,6 +40,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getFunctionalConstraint()
* @model extendedMetaData="name='tFunctionalConstraint' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='abbreviationAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot abbreviationAttributeRequired='Tuple {\n\tmessage : String = \'The abbreviation attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.abbreviation <> null\n}.status'"
* @generated
*/
public interface FunctionalConstraint extends NsdObject {
......
......@@ -36,6 +36,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getLNClass()
* @model extendedMetaData="name='tLNClass' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface LNClass extends AnyLNClass {
......@@ -154,6 +156,7 @@ public interface LNClass extends AnyLNClass {
* extendedMetaData="kind='attribute' name='name'"
* @generated
*/
@Override
String getName();
/**
......@@ -207,6 +210,7 @@ public interface LNClass extends AnyLNClass {
* @model opposite="lNClass" resolveProxies="false" unsettable="true" ordered="false"
* @generated
*/
@Override
LNClasses getLNClasses();
/**
......
......@@ -35,6 +35,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getLiteral()
* @model extendedMetaData="name='tLiteral' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired literalValAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status' literalValAttributeRequired='Tuple {\n\tmessage : String = \'The literalVal attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.literalVal <> null\n}.status'"
* @generated
*/
public interface Literal extends DocumentedClass {
......
......@@ -36,6 +36,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getNSDoc()
* @model extendedMetaData="name='tNSDoc' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='langAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot langAttributeRequired='Tuple {\n\tmessage : String = \'The lang attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.lang <> null\n}.status'"
* @generated
*/
public interface NSDoc extends Copyrighted, AgNSIdentification, AgUML {
......
......@@ -44,6 +44,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getPresenceCondition()
* @model extendedMetaData="name='tPresenceCondition' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name <> null\n}.status'"
* @generated
*/
public interface PresenceCondition extends NsdObject {
......
......@@ -38,6 +38,8 @@ import org.eclipse.emf.common.util.EList;
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getServiceCDC()
* @model extendedMetaData="name='tServiceCDC' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='cdcAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot cdcAttributeRequired='Tuple {\n\tmessage : String = \'The cdc attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.cdc <> null\n}.status'"
* @generated
*/
public interface ServiceCDC extends NsdObject {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment