enrich your models with ocl

Download Enrich Your Models With OCL

If you can't read please download the document

Upload: edward-willink

Post on 16-Apr-2017

12.756 views

Category:

Technology


2 download

TRANSCRIPT

Enrich Your Models with OCL

Edward Willink, ThalesEclipse (MDT) OCL Project Lead

Axel Uhl, SAP
Eclipse (MDT) OCL Committer

21st March 2011

Tutorial Material

EclipseCon Session Page

http://www.eclipsecon.org/2011/sessions/?page=sessions&id=2271link to these slides

link to a ZIP of ZIPs (only one file allowed)

Individual ZIPs on USB stick and atMainWorkspaceProjects.zip

(http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial/MainWorkspaceProjects.zip)RuntimeWorkspaceProjects.zip

(http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial/RuntimeWorkspaceProjects.zip)

Import ... Existing Projects from ArchiveESEExampleTree/model/People1.ecore

Run nested Eclipse, Import ESEExampleTreeESEExampleTree/model/default.people_diagram

Preparation Overview

Strongly recommended (Wifi) - see slidesUnzip ZippedZip.zip from EclipseCon session page

Install Eclipse 3.7M6 (Indigo)

Install New Software ... for Indigo, 6 projects

(Install New Software ... OCL M6b)

Load MainWorkspaceProjects.zip in Eclipse

Load RuntimeWorkspaceProjects.zip in RT Eclipse

Slow last ditch resort (USB stick)Numerous Installs (see USB stick README)

Preparation from USB stick alone

Copy one platform from Eclipse3.7M6Platforms

Copy all projects from Eclipse3.7M6Projects

Copy all files from EclipseCon2011OCL

Follow instructions in README.noWiFi

Preparation - Indigo M6 Platform

Install Eclipse 3.7M6 (or M5)e.g. Download & Unzip
eclipse-SDK-3.7M6-win32.zip
or
eclipse-modeling-indigo-M6-incubation-win32.zip

known lower bounds: OCL M6, Xtext M6, EMF M5

Start Eclipse, with plenty of memory, e.g.

C:\Tools\Eclipse\3.7M6EclipseCon\eclipse.exe
-data C:/EclipseCon/Workspace -vmargs -Xmx1g
-XX:PermSize=64M -XX:MaxPermSize=128M

Preparation - Indigo M6 Projects

Help->Install New Software... from

Indigo - http://download.eclipse.org/releases/indigoModeling->Acceleo SDK

Modeling->Graphical Modeling Framework (GMF) Runtime

Modeling->OCL Examples and Editors

Modeling->Operational QVT SDK

Modeling->UML2 Extender SDKpart of Modelling EPP

Modeling->Xtext SDK

uncheck
"Contact all sites during install to find required software"

Next ... Restart Now

Preparation - Indigo M6b Updates

M6b for OCL Examplesoptional but useful fixes for OCL

no help for adverse SWT/Modeling interaction

Help->Install New Software... from

http://download.eclipse.org/modeling/mdt/ocl/updates/milestonesor USB stick: mdt-ocl-Update-3.1.0M6b.zip

MDT/OCL (3.1.0-v20110320...)

Preparation - Main Workspace

Close Wecome

File->Import->GeneralExisting Projects into Workspace

Next

Select achive File: MainWorkspaceProjects.zipFinish9 projects

0 errors

98 warnings

Preparation - Runtime Eclipse

Run->Run ConfigurationsSelect Eclipse->Eclipse OCL Tutorial

Sun JVMRunsets VM arguments for plenty of memory, e.g.

-Xms40m -Xmx512m
-XX:PermSize=64M -XX:MaxPermSize=128MOther JVMSelect the "Arguments" tabSet VM arguments for plenty of memory

Run

Preparation - Runtime Workspace

Close Wecome

File->Import->GeneralExisting Projects into Workspace

Next

Select achive File: RuntimeWorkspaceProjects.zipFinish3 projects

0 errors

3 warnings

Part 1: OCL in isolation

Why OCL?Easy - similar JavaOCL Basic Facilities
exercises

Sensible - different to JavaOCL Collections

Powerful - more relevant than JavaOCL Iterators
exercises

Tool support - available and improving

Part 2: OCL in combination

State Machine ExampleXtext Editor for States ModelOCL document - independent validation language
exercises

OCLinEcore - integrated validation language
exercises

Acceleo States to Java Classes transformationOCL in Acceleo - navigation/evaluation aid
exercises

QVTo State Flattening transformationOCL in QVT Operational - navigation/evaluation aid
exercises

The OCL Landscape

OCLThe LanguageExecute:
OCL InterpreterEdit:
Essential OCLInput:
LPG ParserEvaluate:
OCL ConsoleValidate:
EMF ToolsValidate:
Xtext ToolsExecute:
Acceleo ToolsExecute:
QVTo Tools

Java Modeler

Informal Debug

Specification Author

Edit:
OCLinEcore

EMF Modeler

Edit:
Complete OCL

DSLModeler

Edit:
Extensible OCL

M2TModeler

M2MModeler

Part 1: OCL in isolation

Why OCL?Easy - similar JavaOCL Basic Facilities
exercises

Sensible - different to JavaOCL Collections

Powerful - more relevant than JavaOCL Iterators
exercises

Tool support - available and improving

Models

The world is full of data

Models are good for controlling data

EMF is good for (meta-)modeling

Extended EMF even betterEMF editors

Xtext editors

Java is empowering

What more could you want?

Rules

The world is full of rulespassword must be at least 6 characters

password must contain only letters and numbers

Models should be good for applying rulesdirect implementation for simple rules

semantic validation for complex rules

EMF (meta-modeling) captures simple rulesmultiplicity, ordering, uniqueness, containment

OCL supports complex rulesused extensively in OMG specifications

Behaviors

The world is full of behaviorsthings happen

changes occur

EMF (and OCL) support static data models

M2M supports changing/related models

OCL underpins modern modeling specificationsUML: state machine guards/transitions

M2M: ATL, Epsilon, VIATRA, QVTo (OMG QVT)

M2T: Acceleo (OMG MOFM2T)

Object Constraint Language

Requirement:an expression language for models

Influences:Fortranprovided fundamental expression/function notation

Evolution'.' operator for records/structures/objects/operations

OCL extensionfrom objects

to collections of model elements

Simple Meta-Modeling

GraphicsBoxClass, enumeration

CompartmentProperty, operation

LineAssociation

DecorationComposition, navigability

TextName, type, stereotype

Multiplicity

Example Family Tree Meta-ModelEcore Diagram(similar to UML Class Diagram)

Richer Meta-Modelling

Implicit constraintsUp to 2 parents

MALE/FEMALE gender

Arbitrary constraintsAt least 5 characters in name

1 MALE, 1 FEMALE parent

Self is not an ancestor of self

Example Family Tree Model

Simple GMF Diagram EditorRuntime Workspace: ...playspace/model/default.people_diagram

Simple Query Evaluation

Window->Show View->Other... Console
Console: New: Interactive Xtext OCL
Select Zeus as the Model Context
Type children then carriage return

Part 1: OCL in isolation

Why OCL?Easy - similar JavaOCL Basic Facilities
exercises

Sensible - different to JavaOCL Collections

Powerful - more relevant than JavaOCL Iterators
exercises

Tool support - available and improving

OCL Principles

Natural/Formal Language compromisenatural language error prone"press any key to continue", "press enter or stop"

formal language unapproachable to many

x y z(x)

Specification (not Programming) Languagedeclarative, modeling language

side effect free, no model changes, atomic execution

strongly typed, using UML generalization

Primitive Types and Literals

Java (implementation)OCL (specification)

boolean,Boolean,true,falseBoolean,true,false

short,int,long,Integer,BigIntegerInteger, UnlimitedNatural

float, double, BigDecimalReal

Character, String, 'c', "line\n"String, 'c', 'line\n'

Object,this,nullOclAny,self,null

Exceptioninvalid

Integer valuevalue : Integer

Java: practical implementation languageOCL: simpler, idealistic, specification language

Mathematical Operators

Java (implementation)OCL (specification)

+, -, *, /+, -, *, /

!, &&, ||, ^not, and, or, xor, implies

, =, =

==, !==,

Math.max(4,5)4.max(5)

if (a) b; else c;if a then b else c endif

Integer value = 5;
doSomething(value);let value : Integer = 5in doSomething(value)

More Complex Query

Selecting Hera defines the implicit context variableself : Person = Hera

Object Navigation

Propertiesself.name or just name
(cf. this.getName() or getName())

Operationsself.child('John') or just child('John')
(cf. this.child("John") or child("John"))

OCL in context

Pure OCL expressionsacademic interest

OCL expressions for modelsuseful for practice/experiment

adds value to model usageEssential OCL editor embedded in Console

OCL expressions for meta-modelsadds value to meta-models

transforms the capabiltiesOCLinEcore editor

EMF Delegates (Helios)

EOperations have no bodygenmodel: UnsupportedOperationException stub

EOperation may have a special EAnnotationconfigures an Invocation Delegate

Eclipse OCL provides OCL Invocation Delegate

SimilarlyValidation Delegate for EClassifier invariants

Setting Delegate for EStructuralFeature initial value

Example Validation Delegate

The OCLinEcore Editor

OCLinEcore editor maintains EAnnotations automatically
OCLinEcore editor provides OCL syntax checking
OCLinEcore editor will provide OCL semantic checking

OCLinEcore Editor

Open with -> OCLinEcore

Save As *.ecoreLoses formatting and comments

Save As *.oclinecoreText file preserves comments

Useful for plain Ecore too:Printable/reviewable text

Searchable/replaceable text

Example Validation Failure

Open ESEExampleTree/model/People1.xmi in Main Eclipse,
with Sample Reflective Ecore Editor
Select Universe, Right button menu, Validate

Evaluator exercises

In Runtime Eclipseopen ...playspace/model/default.people_diagram

open Console, then Interactive Xtext Console

identify parents of Zeus

determine the number of letters in Hephaestushint: String::size() : Integer

OCLinEcore exercises

In Main Eclipseopen ESEExampleTree/model/people1.xmiValidate

inspect validation failures

edit people1.ecore as OCLinEcorechange name limit to at most five characters

save

revalidate

open your own favourite Ecore file as OCLinEcore

Part 1: OCL in isolation

Why OCL?Easy - similar JavaOCL Basic Facilities
exercises

Sensible - different to JavaOCL Collections

Powerful - more relevant than JavaOCL Iterators
exercises

Tool support - available and improving

Multiplicities and Collections

Meta-models specify multiplicitieschildren : Person[*] {ordered,unique}

parents : Person[0..2] {unique}

multiplicities are specification concepts; not objects

Implementations (e.g. Ecore) reify multiplicitiesgetName() setName(newName)

'many' properties have extra implementation objectsgetChildren() returns a UniqueEList

getChildren().get(2) getChildren().add(newChild)

OCL needs more than just UML multiplicities

OCL 2.0 Collections

Typed Collections partially reify multiplicities

Collections are different to objectsNavigation from a Collection uses ->[Navigation from an Object (OclAny) uses .]

Collections have type parametersCollections have useful operationsCollections have very useful iterationsCollections are immutable

Collection(T)UnorderedOrdered

Non-UniqueBag(T)Sequence(T)

UniqueSet(T)OrderedSet(T)

Example Collection Operations

Collection::size() self.children->size()'get' Sequence::at(Integer) self.children->at(1)nb 1 is the first index, size() is the last

'add' Collection(T)::including(T) : Collection(T)returns a new collection with added content

'contains' Collection(T)::includes(T) : Booleantests existing content

Part 1: OCL in isolation

Why OCL?Easy - similar JavaOCL Basic Facilities
exercises

Sensible - different to JavaOCL Collections

Powerful - more relevant than JavaOCL Iterators
exercises

Tool support - available and improving

Collection::select iteration

Children

self.childrenSons

self.children->select(gender = Gender::MALE)self.children->select(child | child.gender = Gender::MALE)
self.children->select(child : Person | child.gender = Gender::MALE)

select(iterator : type | body)filters to select elements for which the body is true

reject(iterator : type | body)filters to reject elements for which the body is true

cf multi-line Java loop

Collection::collect iteration

Children

self.childrenGrandchildren

self.children->collect(children)
self.children->collect(child | child.children)
self.children->collect(child : Person | child.children)

collect(iterator : type | body)creates a new collection comprising all the bodies

Some Other Collection Iterators

any(iterator : type | body)(an arbitrary) any element for which body is true

exists(iterator : type | body)
exists(iterator1 : type, iterator2 : type | body)true if body is true for some element

forAll(iterator : type | body)
forAll(iterator1 : type, iterator2 : type | body)true if body is true for all elements

isUnique(iterator : type | body)true if body is distinct for all elements

one(iterator : type | body)true if body is true for exactly one element

Some OrderedCollection Iterators

sortedBy(iterator : type | body)an ordered of the elementsordered by the < operation of the body's type

The iterate Iterators

All iterations are degenerate iterate calls.iterate(iterator : T1;
accumulator : T2 = initializer
| body) : T2initializationaccumulator = initializer

iteration using iteratoraccumulator = body

body may involve accumulator and/or iterator

resultaccumulator

OCL Navigation Operators

anObject. ... object navigation
aCollection-> ... collection navigation

ShorthandsaCollection. ... implicit collect
anObject-> ... implicit as set

ObjectCollection

.Navigation?

->?Navigation

Implicit Collect Query

parents.parents = parents->collect(parents)3 symbols, compared to 4 lines of Java4 grandparents, but not all different!

Cleaned up query

parents.parents->asSet()->sortedBy(name)->asSet() converts to Set(Person), removes duplicates->sortedBy(name) alphabeticizes

Implicit As Set Conversion

object ->Converts object (if a defined) to a Set of object

object->notEmpty()Standard OCL idiom

ObjectCollection

.NavigationImplicit collect()

->Implicit as setNavigation

objectas set resultnotEmpty() result

defined objectSet{object}true

null, undefined objectSet{}false

invalid, errorinvalidinvalid

Collection::closure iteration

children, grandchildren, greatgrandchildren etc

self->closure(children)Implicit collection of self, then closure of all children

[ closure in MDT/OCL 1.2, in OMG OCL 2.3 ]

OCL as Implementation

any(x) iteration selects an arbitrary element for which x is true.

Derived Properties

For Herainvariant MixedGenderParents: father.gender mother.gender;fails because
father is null and
mother is null

Collection, Iteration exercises

In Runtime Eclipseopen ...playspace/model/default.people_diagram

open Console, then Interactive Xtext Console

repeat slide examples

determine all ancestors of Zeus

determine all ancestors of Hephaestus

determine all four-lettered ancestors of Ares

determine the number of siblings of Perseus

Other OCL Capabilities

No time to mentionOther operations

Tuples

Association Classes/Qualifiers

@pre values

Messages

States

OCL in Code - Java API

MDT/OCL started as a Java APIparsing OCL

evaluating OCL

Facade to hide internals

'Internal' API for derived language parse/evaluate

OCL can be much faster than Java!OCL amenable to analysis

The Re-Evaluation Problem

System defined by a set of OCL expressions

System comprising a set of model elements

A model element changes ....

Which of the OCL expressions may have changed its value on which context elements?

Nave approachre-evaluate all expressions for all their contexts

takes O(|expressions| * |modelElements|)

The Impact Analyzer

Smart approach

pre-evaluate all OCL expression dependencies

re-evaluateonly changed model elements

only expressions for which model element is changed

Go to Efficient, Scalable Notification Handling for EMF (2 hours ago).

Benchmark Context Reduction
(Average Case)

Naive

Event-Filtered (*6 Speed-Up)

Event-Filtered and Context-Reduced
(*1300 Speed-Up vs. Naive,
*220 vs. Event-Filtered-Only)

Total Re-Evaluation Time in Seconds

Number of Model Elements

Benchmark Context Reduction (Worst Case)

Naive

Event-Filtered (*2.4 Speed-Up)

Event-Filtered and Context-Reduced
(*27 Speed-Up vs. Naive, *11 vs. Event-Filtered-Only)

Total Re-Evaluation Time in Seconds

Number of Model Elements

(apply changes to very central elements, referenced by all other model packages)

Part 2: OCL in combination

State Machine ExampleXtext Editor for States ModelOCL document - independent validation language
exercises

OCLinEcore - integrated validation language
exercises

Acceleo States to Java Classes transformationOCL in Acceleo - navigation/evaluation aid
exercises

QVTo State Flattening transformationOCL in QVT Operational - navigation/evaluation aid
exercises

Simple State Machine DSL

module "simple.states"

statemachine Machine{ events START STOP; state Start { STOP => Stop } initial state Stop { START => Start } }

The Xtext States Grammar
http://www.eclipse.org/modeling/mdt/ocl/docs/publications/EclipseCon2011Tutorial
/org.eclipse.ocl.tutorial.eclipsecon2011.states/src/org/eclipse/ocl/tutorial/eclipsecon2011/States.xtext

grammar org.eclipse.ocl.tutorial.eclipsecon2011.States with org.eclipse.xtext.common.Terminalsgenerate states "http://ocl.eclipse.org/tutorial/eclipsecon2011/States"Module: 'module' name=STRING (machines+=Statemachine)*;Statemachine: (initial?='initial')? 'statemachine' name=ID ('value' value=INT)? '{' 'events' (events+=Event)* ';' (states+=State)* '}';Event: name=ID;State: SimpleState | CompoundState;SimpleState: (initial?='initial')? 'state' name=ID ('value' value=INT)? '{' (transitions+=Transition)* '}';CompoundState: 'compound' (initial?='initial')? 'state' name=ID 'machine' machine=[Statemachine] '{' (transitions+=Transition)* '}';Transition: event=[Event] '=>' state=[State];

Validation

Diagnose inappropriate source textXtext grammarvalidates syntax and some semanticstypos:

inappropriate names:

Additional Java/Check Validatorspecialized validation

External Complete OCL Validation

Embedded OCLinEcore Validation

External Complete OCL Validation

Xtext States projectsrc-gen/.../States.ecoreauto-generated; don't want to edit it

META-INF/MANIFEST.MFadd dependency on

org.eclipse.ocl.examples.xtext.completeoclsrc/.../validation/StatesJavaValidator.javagenerated once; can edit it

Helpwanted: validation.CompleteOCLValidatorFragment

StatesJavaValidator.java

Use Java Validator to invoke Complete OCL

import org.eclipse.emf.common.util.URI;import org.eclipse.ocl.examples.xtext.completeocl.validation.CompleteOCLEObjectValidator;import org.eclipse.ocl.tutorial.eclipsecon2011.states.StatesPackage;import org.eclipse.xtext.validation.EValidatorRegistrar;

public class StatesJavaValidator extends AbstractStatesJavaValidator{ @Override public void register(EValidatorRegistrar registrar) { super.register(registrar); StatesPackage ePackage = StatesPackage.eINSTANCE; URI oclURI = URI.createPlatformResourceURI( "/org.eclipse.ocl.tutorial.eclipsecon2011.states.ocl/model/States.ocl", true); registrar.register(ePackage, new CompleteOCLEObjectValidator(ePackage, oclURI)); }}

Complete OCL Validation 1
/org.eclipse.ocl.tutorial.eclipsecon2011.states.ocl/model/States.ocl

import 'http://ocl.eclipse.org/tutorial/eclipsecon2011/States'package statescontext Statemachineinv HasInitialState('No initial state'): states->exists(s : State | s.initial)endpackage

Evaluates: states->exists(s : State | s.initial)true => silent, invariant is satisfiedfalse => invariant is not satisfied evaluates 'No initial state' to determine warning diagnosticnull => invariant is not satisfied evaluates 'No initial state' to determine error diagnosticinvalid => exception, evaluation failure

Eclipse OCL Pragmatics

Eclipse OCL Extensionproposed to OMG

Xtext with independent OCL

Main Eclipsemeta-modeling

Edit states.xtext

Tailor Editor

Generate States EditorGenerate states.ecore

Edit states.ocl

Run-time Eclipsemodeling

Exit Run-time

Start Run-time

Edit simple.states

Exit Run-time

Start Run-time

Edit simple.stateswith OCL validation

Example Invariant Violation

Complete OCL Validation 2

context Statemachinedef: asError(verdict : Boolean) : Boolean = if verdict then true else null endifinv HasInitialState('No initial state'): asError(states->exists(s : State | s.initial))

context SimpleStateinv NameLength('\'' + name + '\' has ' + name.size().toString() + ' characters when at least 4 wanted'): name.size() >= 4 inv NameIsLeadingUpperCase('\'' + name + '\' must be Leading Uppercase'): let firstLetter : String = name.substring(1,1) in firstLetter.toUpperCase() = firstLetter

Complete OCL Validation 3

context SimpleStatedef: statemachine : Statemachine = oclContainer()->oclAsType(Statemachine)

inv UniqueInitialState('There is more than one initial state'): initial implies statemachine.states->select(initial)->size() = 1

inv EveryEventIsHandled( let allEvents : Set(Event) = statemachine.events->asSet(), myEvents : Set(Event) = self.transitions.event->asSet() in (allEvents - myEvents)->iterate(e : Event; s : String = 'The following events are not handled:' | s + ' ' + e.name)): let allEvents : Set(Event) = statemachine.events->asSet(), myEvents : Set(Event) = self.transitions.event->asSet() in (allEvents - myEvents)->isEmpty()

Composite Validation Errors

Complete OCL Exercises 1

Open Simple.states in Run-time Eclipseedit and see similar errors to previous slide

add additional state

Exit Run-time Eclipseedit States.oclchange NameIsLeadingUpperCase to NameIsUppercase

restart Run-time Eclipse

check that NameIsUppercase is working

Complete OCL Exercises 2

Add a StateIsReachable invarianttip 1: a sequence of transitions from an initial state reaches the state in question

tip 2: the closure of all transitions from all initial states includes the state in question

Complete OCL activation

XtextCompleteOCLEObjectValidator

Interactive Xtext OCL ConsoleManual Load Resource

States.ecoresimple.statesModelingTool

eClass,eType

load

States.ocl

referredType

????

Model URI Resolution

Main Eclipse, no Global Package Registry

platform:/resource/org.eclipse.ocl.tutorial.eclipsecon2011.states/
src-gen/org/eclipse/ocl/tutorial/eclipsecon2011/States.ecoreRun-time Eclipse, no Project Resources

http://ocl.eclipse.org/tutorial/eclipsecon2011/StatesComplete OCLeditor runs in Main Eclipse

executed in Run-time Eclipse

OCL Model Registry, Project Package Registry

OCL Model Registry

URI mappingDefined for: org.eclipse.ocl.tutorial.eclipsecon2011.states.ocl

AccessorName: http://ocl.eclipse.org/tutorial/eclipsecon2011/States

Model URI:

platform:/resource/org.eclipse.ocl.tutorial.eclipsecon2011.states/
src-gen/org/eclipse/ocl/tutorial/eclipsecon2011/States.ecore

Complete OCL Validation

Independent add-on to an Ecore fileno need to edit the auto-generated Ecore file

need to register the Complete OCL for validation

Not part of the editor frameworkre-useable in other tool contexts

need to inform tool of Complete OCL existence

UML specified with additional Complete OCL

Part 2: OCL in combination

State Machine ExampleXtext Editor for States ModelOCL document - independent validation language
exercises

OCLinEcore - integrated validation language
exercises

Acceleo States to Java Classes transformationOCL in Acceleo - navigation/evaluation aid
exercises

QVTo State Flattening transformationOCL in QVT Operational - navigation/evaluation aid
exercises

Xtext with embedded OCL

Main Eclipsemeta-modeling

Edit states.xtext
or states.ecore with OCL

Tailor Editor

Generate OCLStates Editor

GenModel States

Run-time Eclipsemodeling

Exit Run-time

Start Run-time

Edit simple.stateswith OCL validation

Embedded OCL Validation

OCLinEcore editor embeds OCL in Ecoreno need to inform tools that OCL exists

EMF automatically invokes OCL via delegates

Ecore can no longer be autogeneratedoften appropriate for stable models anyway

OCLStates.ecoresimple.oclstatesModelingTool

eClass,eType

load

embeddedOCL

Move Ecore

Move States.ecore, States.genmodelfrom org.eclipse.ocl.tutorial.eclipsecon2011.states/
src-gen/org/eclipse/ocl/tutorial/eclipsecon2011/States.ecore

to org.eclipse.ocl.tutorial.eclipsecon2011.oclstates/
model/OCLStates.ecore

change all ...States.ecore refs to OCLStates.ecore

Import rather than Generate Ecore

grammar org.eclipse.ocl.tutorial.eclipsecon2011.States with org.eclipse.xtext.common.Terminalsgenerate states "http://ocl.eclipse.org/tutorial/eclipsecon2011/States"import "platform:/resource/org.eclipse.ocl.tutorial.eclipsecon2011.oclstates/model/OCLStates.ecore"

(Change MWE2 script to *.oclstates)

The Generate OCLStates Editor launch may be used

Optional Workaround Bug 322639

Use of EObjectValidator gives'An object may not circularly contain itself'

NoEObjectValidator setUseEObjectValidator(false)

import org.eclipse.ocl.examples.xtext.base.utilities.NoEObjectCompositeEValidator;import org.eclipse.xtext.validation.CompositeEValidator;

/** * Use this class to register components to be used at runtime / without the Equinox extension registry. */public class StatesRuntimeModule extends org.eclipse.ocl.tutorial.eclipsecon2011.AbstractStatesRuntimeModule{ public Class