blob: 2afd9b9c2dfd6643644fb3a0922cf0f8db23967f [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:ocl4uml="http://www.eclipse.org/ocl/2015/OCLforUML/1" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
<uml:Model xmi:id="_9uAWYCiBEeOgPJa2W3yNiA" name="Bug 417062 - Validate instance specifications">
<ownedComment xmi:id="_PEWFMCiEEeOgPJa2W3yNiA" annotatedElement="_cf4vMCiCEeOgPJa2W3yNiA">
<body>Standard valid case</body>
</ownedComment>
<ownedComment xmi:id="_RHfosCiEEeOgPJa2W3yNiA" annotatedElement="_h4GKACiCEeOgPJa2W3yNiA">
<body>Invalid case. The value is defined as a LiteralInteger (Which is valid), but is negative (Which is invalid)</body>
</ownedComment>
<ownedComment xmi:id="_WWuGoCiEEeOgPJa2W3yNiA" annotatedElement="_C56lICiDEeOgPJa2W3yNiA">
<body>Partial specification. There is no price at all. This is legal</body>
</ownedComment>
<ownedComment xmi:id="_aiMokCiEEeOgPJa2W3yNiA" annotatedElement="_Ox0nQCiDEeOgPJa2W3yNiA">
<body>Opaque specification. Probably invalid because there are three different values.</body>
</ownedComment>
<packageImport xmi:id="_9uAWYSiBEeOgPJa2W3yNiA">
<importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
<packagedElement xmi:type="uml:Class" xmi:id="__pjdECiBEeOgPJa2W3yNiA" name="Book">
<ownedRule xmi:id="_N5VVgCiCEeOgPJa2W3yNiA" name="Price must be greater than 0">
<specification xmi:type="uml:OpaqueExpression" xmi:id="_Xmae0CiCEeOgPJa2W3yNiA">
<language>OCL</language>
<body>self.price > 0</body>
</specification>
</ownedRule>
<ownedAttribute xmi:id="_AWk7ICiCEeOgPJa2W3yNiA" name="price">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
<defaultValue xmi:type="uml:LiteralInteger" xmi:id="_PnC0gCiCEeOgPJa2W3yNiA"/>
</ownedAttribute>
<ownedAttribute xmi:id="_SakFACiCEeOgPJa2W3yNiA" name="title">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
</ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:InstanceSpecification" xmi:id="_cf4vMCiCEeOgPJa2W3yNiA" name="1) Valid book" classifier="__pjdECiBEeOgPJa2W3yNiA">
<slot xmi:id="_dRmgACiCEeOgPJa2W3yNiA" definingFeature="_AWk7ICiCEeOgPJa2W3yNiA">
<value xmi:type="uml:LiteralReal" xmi:id="_GqA9MCiEEeOgPJa2W3yNiA" name="price" value="7.5"/>
</slot>
</packagedElement>
<packagedElement xmi:type="uml:InstanceSpecification" xmi:id="_h4GKACiCEeOgPJa2W3yNiA" name="2) Invalid book" classifier="__pjdECiBEeOgPJa2W3yNiA">
<slot xmi:id="_lWgKkCiCEeOgPJa2W3yNiA" definingFeature="_AWk7ICiCEeOgPJa2W3yNiA">
<value xmi:type="uml:LiteralInteger" xmi:id="_lWgxoCiCEeOgPJa2W3yNiA" name="price" value="-15"/>
</slot>
</packagedElement>
<packagedElement xmi:type="uml:InstanceSpecification" xmi:id="_C56lICiDEeOgPJa2W3yNiA" name="3) Book with undefined price" classifier="__pjdECiBEeOgPJa2W3yNiA"/>
<packagedElement xmi:type="uml:InstanceSpecification" xmi:id="_Ox0nQCiDEeOgPJa2W3yNiA" name="4) Opaque expressions and other things" classifier="__pjdECiBEeOgPJa2W3yNiA">
<slot xmi:id="_SjW_MCiDEeOgPJa2W3yNiA" definingFeature="_AWk7ICiCEeOgPJa2W3yNiA">
<value xmi:type="uml:OpaqueExpression" xmi:id="_fNkoACiDEeOgPJa2W3yNiA">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
<language>Natural language</language>
<language>OCL</language>
<body>Can you even validate that? My value is 3.40£</body>
<body>3 + 0.4</body>
</value>
<value xmi:type="uml:LiteralInteger" xmi:id="_kqh_8CiDEeOgPJa2W3yNiA" name="Another value" value="3"/>
<value xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_nH5aQCiDEeOgPJa2W3yNiA" value="*"/>
</slot>
</packagedElement>
<profileApplication xmi:id="_Z-7e4P9yEeS5-awt08lsYA">
<eAnnotations xmi:id="_Z-7e4f9yEeS5-awt08lsYA" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="http://www.eclipse.org/ocl/2015/OCLforUML/1#/"/>
</eAnnotations>
<appliedProfile href="pathmap://OCL_PROFILES/OCLforUML.profile.uml#_0"/>
</profileApplication>
</uml:Model>
<ocl4uml:Validations xmi:id="_dIGPQP9yEeS5-awt08lsYA" base_Package="_9uAWYCiBEeOgPJa2W3yNiA" validateInstanceSpecifications="true"/>
</xmi:XMI>