employee
Company
name
employees
departments
Department
manager
deptID
name
employees
company
Employee
allReports
reportingChain
reportsTo
mgr
isManager
department
manager
directReports
empID
name
company
<?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="employee"
    nsURI="http://www.eclipse.org/OCL/examples/codegen/employee" nsPrefix="emp">
  <eClassifiers xsi:type="ecore:EClass" name="Company">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" 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:EReference" name="departments" upperBound="-1"
        eType="#//Department" containment="true" eOpposite="#//Department/company"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Department">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="deptHasEmployees positiveID validName"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/ocl/examples/OCL">
      <details key="deptHasEmployees" value="not manager.oclIsUndefined() implies employees->notEmpty()"/>
      <details key="positiveID" value="self.deptID > 0"/>
      <details key="validName" value="not self.name.oclIsUndefined() and self.name &lt;> ''"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="manager" eType="#//Employee"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="deptID" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" iD="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="employees" ordered="false"
        upperBound="-1" eType="#//Employee" changeable="false" volatile="true" transient="true"
        derived="true" eOpposite="#//Employee/department">
      <eAnnotations source="http://www.eclipse.org/ocl/examples/OCL">
        <details key="derive" value="if manager.oclIsUndefined() then Set{} else manager.directReports endif"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="company" eType="#//Company"
        eOpposite="#//Company/departments"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Employee">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="positiveID validName"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/ocl/examples/OCL">
      <details key="positiveID" value="self.empID > 0"/>
      <details key="validName" value="not self.name.oclIsUndefined() and self.name &lt;> ''"/>
    </eAnnotations>
    <eOperations name="allReports" ordered="false" upperBound="-1" eType="#//Employee">
      <eAnnotations source="http://www.eclipse.org/ocl/examples/OCL">
        <details key="body" value="self->closure(directReports)"/>
      </eAnnotations>
    </eOperations>
    <eOperations name="reportingChain" upperBound="-1" eType="#//Employee">
      <eAnnotations source="http://www.eclipse.org/ocl/examples/OCL">
        <details key="body" value="if manager.oclIsUndefined() then OrderedSet{} else manager.reportingChain()->prepend(manager) endif"/>
      </eAnnotations>
    </eOperations>
    <eOperations name="reportsTo" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/ocl/examples/OCL">
        <details key="body" value="self.reportingChain()->includes(mgr)"/>
      </eAnnotations>
      <eParameters name="mgr" eType="#//Employee"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="isManager" 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/ocl/examples/OCL">
        <details key="derive" value="directReports->notEmpty()"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="department" eType="#//Department"
        changeable="false" volatile="true" transient="true" derived="true" eOpposite="#//Department/employees">
      <eAnnotations source="http://www.eclipse.org/ocl/examples/OCL">
        <details key="derive" value="company.departments->any(employees->includes(self))"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="manager" eType="#//Employee"
        eOpposite="#//Employee/directReports"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="directReports" ordered="false"
        upperBound="-1" eType="#//Employee" eOpposite="#//Employee/manager"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="empID" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
        iD="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="company" eType="#//Company"
        eOpposite="#//Company/employees"/>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"emp","nsURI":"http://www.eclipse.org/OCL/examples/codegen/employee","name":"employee","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":"Department","instanceClass":null,"abstract":false,"id":2,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Employee","instanceClass":null,"abstract":false,"id":3,"interface":false,"eClass":"EClass"},{"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":4,"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":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":"departments","changeable":true,"resolveProxies":true,"lowerBound":0,"id":6,"derived":false},{"id":7,"eClass":"EGenericType"},{"id":8,"eClass":"EGenericType"},{"container":true,"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":"company","changeable":true,"resolveProxies":true,"lowerBound":0,"id":9,"derived":false},{"id":10,"eClass":"EGenericType"},{"container":true,"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":"company","changeable":true,"resolveProxies":true,"lowerBound":0,"id":11,"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":12,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":0,"volatile":false,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"deptID","changeable":true,"lowerBound":1,"iD":true,"id":13,"derived":false},{"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":14,"derived":false},{"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":"employees","changeable":false,"resolveProxies":true,"lowerBound":0,"id":15,"derived":true},{"id":16,"eClass":"EGenericType"},{"id":17,"eClass":"EGenericType"},{"id":18,"eClass":"EGenericType"},{"id":19,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":true,"many":false,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":true,"unique":true,"name":"department","changeable":false,"resolveProxies":true,"lowerBound":0,"id":20,"derived":true},{"id":21,"eClass":"EGenericType"},{"ordered":false,"upperBound":-1,"unique":true,"name":"allReports","lowerBound":0,"id":22,"many":true,"required":false,"eClass":"EOperation"},{"ordered":true,"upperBound":-1,"unique":true,"name":"reportingChain","lowerBound":0,"id":23,"many":true,"required":false,"eClass":"EOperation"},{"ordered":false,"upperBound":1,"unique":true,"name":"reportsTo","lowerBound":0,"id":24,"many":false,"required":false,"eClass":"EOperation"},{"ordered":true,"upperBound":1,"defaultValue":false,"volatile":true,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":true,"unique":true,"name":"isManager","changeable":false,"lowerBound":0,"iD":false,"id":25,"derived":true},{"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":26,"derived":false},{"container":false,"ordered":false,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"directReports","changeable":true,"resolveProxies":true,"lowerBound":0,"id":27,"derived":false},{"ordered":true,"upperBound":1,"defaultValue":0,"volatile":false,"many":false,"required":true,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"empID","changeable":true,"lowerBound":1,"iD":true,"id":28,"derived":false},{"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":29,"derived":false},{"id":30,"eClass":"EGenericType"},{"id":31,"eClass":"EGenericType"},{"id":32,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"unique":true,"name":"mgr","lowerBound":0,"id":33,"many":false,"required":false,"eClass":"EParameter"},{"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"}],"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":4,"target":7},{"source":4,"target":1},{"source":5,"target":3},{"source":5,"target":8},{"source":5,"target":1},{"source":5,"target":9},{"source":8,"target":3},{"source":6,"target":2},{"source":6,"target":10},{"source":6,"target":1},{"source":6,"target":11},{"source":10,"target":2},{"source":2,"target":0},{"source":2,"target":12},{"source":2,"target":13},{"source":2,"target":14},{"source":2,"target":15},{"source":2,"target":11},{"source":12,"target":3},{"source":12,"target":16},{"source":12,"target":2},{"source":16,"target":3},{"source":13,"target":17},{"source":13,"target":2},{"source":14,"target":18},{"source":14,"target":2},{"source":15,"target":3},{"source":15,"target":19},{"source":15,"target":2},{"source":15,"target":20},{"source":19,"target":3},{"source":11,"target":1},{"source":11,"target":21},{"source":11,"target":2},{"source":11,"target":6},{"source":21,"target":1},{"source":3,"target":0},{"source":3,"target":22},{"source":3,"target":23},{"source":3,"target":24},{"source":3,"target":25},{"source":3,"target":20},{"source":3,"target":26},{"source":3,"target":27},{"source":3,"target":28},{"source":3,"target":29},{"source":3,"target":9},{"source":22,"target":3},{"source":22,"target":30},{"source":22,"target":3},{"source":30,"target":3},{"source":23,"target":3},{"source":23,"target":31},{"source":23,"target":3},{"source":31,"target":3},{"source":24,"target":32},{"source":24,"target":3},{"source":24,"target":33},{"source":33,"target":3},{"source":33,"target":34},{"source":33,"target":24},{"source":34,"target":3},{"source":25,"target":35},{"source":25,"target":3},{"source":20,"target":2},{"source":20,"target":36},{"source":20,"target":3},{"source":20,"target":15},{"source":36,"target":2},{"source":26,"target":3},{"source":26,"target":37},{"source":26,"target":3},{"source":26,"target":27},{"source":37,"target":3},{"source":27,"target":3},{"source":27,"target":38},{"source":27,"target":3},{"source":27,"target":26},{"source":38,"target":3},{"source":28,"target":39},{"source":28,"target":3},{"source":29,"target":40},{"source":29,"target":3},{"source":9,"target":1},{"source":9,"target":41},{"source":9,"target":3},{"source":9,"target":5},{"source":41,"target":1}],"multigraph":true}