| <?xml version="1.0" encoding="UTF-8"?> |
| <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="company" nsURI="http://www.eclipse.org/ocl/test/2010/Company.ecore" |
| nsPrefix="co"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> |
| <details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL"/> |
| <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL"/> |
| <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL"/> |
| </eAnnotations> |
| <eClassifiers xsi:type="ecore:EClass" name="Company"> |
| <eOperations name="dummyInvariant" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="body" value="true"/> |
| </eAnnotations> |
| <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> |
| <eParameters name="context"> |
| <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> |
| <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> |
| <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> |
| </eGenericType> |
| </eParameters> |
| </eOperations> |
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> |
| <eStructuralFeatures xsi:type="ecore:EReference" name="employees" upperBound="-1" |
| eType="#//Employee" containment="true" eOpposite="#//Employee/company"/> |
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" lowerBound="1" eType="#//CompanySizeKind" |
| changeable="false" volatile="true" transient="true" derived="true"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="derivation" value="let table : Set(Tuple(range : Sequence(Integer), size : CompanySizeKind)) =
 Set{Tuple{range=Sequence{0..49}, size=CompanySizeKind::small},
 Tuple{range=Sequence{50..999}, size=CompanySizeKind::medium},
 Tuple{range=Sequence{1000..1000000}, size=CompanySizeKind::large}} in
table->any(range->includes(employees->size())).size"/> |
| </eAnnotations> |
| </eStructuralFeatures> |
| </eClassifiers> |
| <eClassifiers xsi:type="ecore:EClass" name="Employee"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> |
| <details key="constraints" value="mustHaveName mustHaveNonEmptyName"/> |
| </eAnnotations> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="mustHaveName" value="not name.oclIsUndefined() and hasNameAsAttribute and hasNameAsOperation()"/> |
| <details key="mustHaveNonEmptyName" value="Tuple {
	message : String = 'this is a \'precondition\'\n',
	status : Boolean = name->notEmpty() implies name.size() > 0
}.status"/> |
| </eAnnotations> |
| <eOperations name="reportsTo" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="body" value="self.reportingChain->includes(manager)"/> |
| </eAnnotations> |
| <eParameters name="manager" eType="#//Employee"/> |
| </eOperations> |
| <eOperations name="noManagerImpliesDirectReports" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="body" value="manager.oclIsUndefined() implies directReports->size() > 0"/> |
| </eAnnotations> |
| <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> |
| <eParameters name="context"> |
| <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> |
| <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> |
| <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> |
| </eGenericType> |
| </eParameters> |
| </eOperations> |
| <eOperations name="hasNameAsOperation" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="body" value="name <> null"/> |
| </eAnnotations> |
| </eOperations> |
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> |
| <eStructuralFeatures xsi:type="ecore:EReference" name="manager" eType="#//Employee"/> |
| <eStructuralFeatures xsi:type="ecore:EReference" name="company" lowerBound="1" |
| eType="#//Company" eOpposite="#//Company/employees"/> |
| <eStructuralFeatures xsi:type="ecore:EReference" name="directReports" upperBound="-1" |
| eType="#//Employee" changeable="false" volatile="true" transient="true" derived="true"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="derivation" value="company.employees->select(manager = self)"/> |
| </eAnnotations> |
| </eStructuralFeatures> |
| <eStructuralFeatures xsi:type="ecore:EReference" name="allReports" ordered="false" |
| upperBound="-1" eType="#//Employee" changeable="false" volatile="true" transient="true" |
| derived="true"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="derivation" value="Employee.allInstances()->select(reportsTo(self))"/> |
| </eAnnotations> |
| </eStructuralFeatures> |
| <eStructuralFeatures xsi:type="ecore:EReference" name="reportingChain" upperBound="-1" |
| eType="#//Employee" changeable="false" volatile="true" transient="true" derived="true"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="derivation" value="if (manager.oclIsUndefined()) then
 OrderedSet{}
else
 manager.reportingChain->prepend(manager)
endif"/> |
| </eAnnotations> |
| </eStructuralFeatures> |
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="hasNameAsAttribute" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" |
| changeable="false" volatile="true" transient="true" derived="true"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="derivation" value="name <> null"/> |
| </eAnnotations> |
| </eStructuralFeatures> |
| </eClassifiers> |
| <eClassifiers xsi:type="ecore:EEnum" name="CompanySizeKind"> |
| <eLiterals name="small"/> |
| <eLiterals name="medium" value="1"/> |
| <eLiterals name="large" value="2"/> |
| </eClassifiers> |
| <eClassifiers xsi:type="ecore:EClass" name="Bug418716"> |
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="AttributeWithInitital" |
| eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> |
| <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL"> |
| <details key="initial" value="100"/> |
| </eAnnotations> |
| </eStructuralFeatures> |
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="AttributeWithoutInitital" |
| eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> |
| </eClassifiers> |
| </ecore:EPackage> |