blob: b77d3b6d1f6244f2ae2fa931902fb882a8272917 [file] [log] [blame]
<?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="oclstates"
nsURI="http://ocl.eclipse.org/tutorial/eclipsecon2011/OCLStates" nsPrefix="oclstates">
<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="Module">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="machines" upperBound="-1"
eType="#//Statemachine" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Statemachine">
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
<details key="constraints" value="HasInitialState"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
<details key="HasInitialState" value="(states)->exists(s : State | s.initial)"/>
<details key="HasInitialState$message" value="'No initial state'"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="initial" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
eType="#//Event" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="states" upperBound="-1"
eType="#//State" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Event">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="State">
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
<details key="constraints" value="UniqueInitialState NameIsLeadingUpperCase NameLength EveryEventIsHandled"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
<details key="UniqueInitialState" value="initial implies (((statemachine).states)->select(initial))->size() = 1"/>
<details key="UniqueInitialState$message" value="'There is more than one initial state'"/>
<details key="NameIsLeadingUpperCase" value="let firstLetter : String = (name).substring(1, 1) in firstLetter.toUpperCase() = firstLetter"/>
<details key="NameIsLeadingUpperCase$message" value="'\'' + name + '\' must be Leading Uppercase'"/>
<details key="NameLength" value="(name).size() >= 4"/>
<details key="NameLength$message" value="'\'' + name + '\' has ' + ((name).size()).toString() + ' characters when at least 4 wanted'"/>
<details key="EveryEventIsHandled" value="let allEvents : Set(Event) = ((statemachine).events)->asSet() in let myEvents : Set(Event) = ((self.transitions)->collect(event))->asSet() in (allEvents - myEvents)->isEmpty()"/>
<details key="EveryEventIsHandled$message" value="let allEvents : Set(Event) = ((statemachine).events)->asSet() in let myEvents : Set(Event) = ((self.transitions)->collect(event))->asSet() in (allEvents - myEvents)->iterate(e : Event ; s : String = 'The following events are not handled:' | s + ' ' + e.name)"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="initial" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="transitions" upperBound="-1"
eType="#//Transition" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="statemachine" ordered="false"
eType="#//Statemachine" derived="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
<details key="derivation" value="(oclContainer()).oclAsType(Statemachine)"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SimpleState" eSuperTypes="#//State">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CompoundState" eSuperTypes="#//State">
<eStructuralFeatures xsi:type="ecore:EReference" name="machine" eType="#//Statemachine"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Transition">
<eStructuralFeatures xsi:type="ecore:EReference" name="event" eType="#//Event"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="state" eType="#//State"/>
</eClassifiers>
</ecore:EPackage>