company
Company
dummyInvariant
diagnostics
context
name
employees
size
Employee
reportsTo
manager
noManagerImpliesDirectReports
diagnostics
context
name
manager
company
directReports
allReports
reportingChain
CompanySizeKind
small
small
medium
medium
large
large
<?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/Pivot/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/Pivot"/>
    <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
    <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
  </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/Pivot">
        <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/Pivot">
        <details key="derivation" value="&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;let table : Set(Tuple(range : Sequence(Integer), size : CompanySizeKind)) =&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;Set{Tuple{range = Sequence{0..49}, size = CompanySizeKind::small},&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;Tuple{range = Sequence{50..999}, size = CompanySizeKind::medium},&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;Tuple{range = Sequence{1000..1000000}, size = CompanySizeKind::large}}&#xA;&#x9;&#x9;&#x9;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"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="mustHaveName" value="not name.oclIsUndefined()"/>
    </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/Pivot">
        <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/Pivot">
        <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>
    <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/Pivot">
        <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/Pivot">
        <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/Pivot">
        <details key="derivation" value="if manager.oclIsUndefined() then OrderedSet{} else manager.reportingChain->prepend(manager) endif"/>
      </eAnnotations>
    </eStructuralFeatures>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EEnum" name="CompanySizeKind">
    <eLiterals name="small"/>
    <eLiterals name="medium" value="1"/>
    <eLiterals name="large" value="2"/>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"co","nsURI":"http://www.eclipse.org/ocl/test/Pivot/Company.ecore","name":"company","id":0,"eClass":"EPackage"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Company","instanceClass":null,"abstract":false,"id":1,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Employee","instanceClass":null,"abstract":false,"id":2,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"instanceClassName":null,"name":"CompanySizeKind","instanceClass":null,"id":3,"serializable":true,"eClass":"EEnum"},{"ordered":true,"upperBound":1,"unique":true,"name":"dummyInvariant","lowerBound":1,"id":4,"many":false,"required":true,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":1,"iD":false,"id":5,"derived":false},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"employees","changeable":true,"resolveProxies":true,"lowerBound":0,"id":6,"derived":false},{"ordered":true,"upperBound":1,"volatile":true,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":true,"unique":true,"name":"size","changeable":false,"lowerBound":1,"iD":false,"id":7,"derived":true},{"id":8,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"diagnostics","lowerBound":0,"id":9,"many":false,"required":false,"eClass":"EParameter"},{"ordered":true,"upperBound":1,"unique":true,"name":"context","lowerBound":0,"id":10,"many":false,"required":false,"eClass":"EParameter"},{"id":11,"eClass":"EGenericType"},{"id":12,"eClass":"EGenericType"},{"id":13,"eClass":"EGenericType"},{"id":14,"eClass":"EGenericType"},{"id":15,"eClass":"EGenericType"},{"id":16,"eClass":"EGenericType"},{"container":true,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"company","changeable":true,"resolveProxies":true,"lowerBound":1,"id":17,"derived":false},{"id":18,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"reportsTo","lowerBound":1,"id":19,"many":false,"required":true,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"unique":true,"name":"noManagerImpliesDirectReports","lowerBound":1,"id":20,"many":false,"required":true,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":0,"iD":false,"id":21,"derived":false},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"manager","changeable":true,"resolveProxies":true,"lowerBound":0,"id":22,"derived":false},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":true,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":true,"unique":true,"name":"directReports","changeable":false,"resolveProxies":true,"lowerBound":0,"id":23,"derived":true},{"container":false,"ordered":false,"upperBound":-1,"defaultValue":null,"volatile":true,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":true,"unique":true,"name":"allReports","changeable":false,"resolveProxies":true,"lowerBound":0,"id":24,"derived":true},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":true,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":true,"unique":true,"name":"reportingChain","changeable":false,"resolveProxies":true,"lowerBound":0,"id":25,"derived":true},{"id":26,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"manager","lowerBound":0,"id":27,"many":false,"required":false,"eClass":"EParameter"},{"id":28,"eClass":"EGenericType"},{"id":29,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"diagnostics","lowerBound":0,"id":30,"many":false,"required":false,"eClass":"EParameter"},{"ordered":true,"upperBound":1,"unique":true,"name":"context","lowerBound":0,"id":31,"many":false,"required":false,"eClass":"EParameter"},{"id":32,"eClass":"EGenericType"},{"id":33,"eClass":"EGenericType"},{"id":34,"eClass":"EGenericType"},{"id":35,"eClass":"EGenericType"},{"id":36,"eClass":"EGenericType"},{"id":37,"eClass":"EGenericType"},{"id":38,"eClass":"EGenericType"},{"id":39,"eClass":"EGenericType"},{"id":40,"eClass":"EGenericType"},{"id":41,"eClass":"EGenericType"},{"name":"small","id":42,"value":0,"literal":"small","eClass":"EEnumLiteral"},{"name":"medium","id":43,"value":1,"literal":"medium","eClass":"EEnumLiteral"},{"name":"large","id":44,"value":2,"literal":"large","eClass":"EEnumLiteral"}],"links":[{"source":0,"target":1},{"source":0,"target":2},{"source":0,"target":3},{"source":1,"target":0},{"source":1,"target":4},{"source":1,"target":5},{"source":1,"target":6},{"source":1,"target":7},{"source":4,"target":8},{"source":4,"target":1},{"source":4,"target":9},{"source":4,"target":10},{"source":9,"target":11},{"source":9,"target":4},{"source":10,"target":12},{"source":10,"target":4},{"source":12,"target":13},{"source":12,"target":14},{"source":5,"target":15},{"source":5,"target":1},{"source":6,"target":2},{"source":6,"target":16},{"source":6,"target":1},{"source":6,"target":17},{"source":16,"target":2},{"source":7,"target":3},{"source":7,"target":18},{"source":7,"target":1},{"source":18,"target":3},{"source":2,"target":0},{"source":2,"target":19},{"source":2,"target":20},{"source":2,"target":21},{"source":2,"target":22},{"source":2,"target":17},{"source":2,"target":23},{"source":2,"target":24},{"source":2,"target":25},{"source":19,"target":26},{"source":19,"target":2},{"source":19,"target":27},{"source":27,"target":2},{"source":27,"target":28},{"source":27,"target":19},{"source":28,"target":2},{"source":20,"target":29},{"source":20,"target":2},{"source":20,"target":30},{"source":20,"target":31},{"source":30,"target":32},{"source":30,"target":20},{"source":31,"target":33},{"source":31,"target":20},{"source":33,"target":34},{"source":33,"target":35},{"source":21,"target":36},{"source":21,"target":2},{"source":22,"target":2},{"source":22,"target":37},{"source":22,"target":2},{"source":37,"target":2},{"source":17,"target":1},{"source":17,"target":38},{"source":17,"target":2},{"source":17,"target":6},{"source":38,"target":1},{"source":23,"target":2},{"source":23,"target":39},{"source":23,"target":2},{"source":39,"target":2},{"source":24,"target":2},{"source":24,"target":40},{"source":24,"target":2},{"source":40,"target":2},{"source":25,"target":2},{"source":25,"target":41},{"source":25,"target":2},{"source":41,"target":2},{"source":3,"target":0},{"source":3,"target":42},{"source":3,"target":43},{"source":3,"target":44},{"source":42,"target":3},{"source":43,"target":3},{"source":44,"target":3}],"multigraph":true}