Author Topic: Modeling an UML Profile with OCL Constraints  (Read 730 times)

SebastianW

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Modeling an UML Profile with OCL Constraints
« on: January 04, 2010, 08:31:31 pm »
Hi everybody,

I want to create an UML Profile that contains OCL Constraints.
After that I want to Validate my UML Model to see if the constraints are accomplished (If the Model was created in conformance with the given OCL constraints).
For the UML Model I use my created UML Profile.
In my UML Profile I have an association that should specify the following constraints:

"At the end and the start of the association are only specified stereotyped classes allowed"

My problem is that I donīt know how to write down this OCL that will be accepted by EA!

e.g.
UML Profile looks like..

<<stereotype>> isAssociated (contains OCL constraints see below)
extends
<<metaclass>> Association

<<stereotype>> MyClass_A and <<stereotype>> MyClass_B
extends
<<metalass>> Class

The constraints should looks like this:

context isAssociated inv:
self.base.participant.isStereotyped('MyClass_A') and
self.base.participant.association.participant
 ->exist(c|c.isStereotyped('MyClass_B'))

I tested that in EA it is possible to use "isStereotyped" but "participant" or "association" are not accepted.
Knows somebody where I can get an example or the supported OCL Syntax accepted by EA.

Thanks for your help
Sebastian


David OD

  • EA User
  • **
  • Posts: 56
  • Karma: +0/-0
    • View Profile
Re: Modeling an UML Profile with OCL Constraints
« Reply #1 on: January 29, 2010, 01:58:23 pm »
Quote
where I can get an example or the supported OCL Syntax accepted by EA

Sebastian

Did anybody enlighten you?  I would be keen to see this information myself.
Regards
David

beginner

  • Guest
Re: Modeling an UML Profile with OCL Constraints
« Reply #2 on: January 29, 2010, 08:03:11 pm »
I might remember this wrongly or EA could have been improved in that respect, but when I fiddled around with OCL I had the impression that EA is just checking the syntax of OCL, no evaluating it - which is a bit of a difference, you see?

b.

David OD

  • EA User
  • **
  • Posts: 56
  • Karma: +0/-0
    • View Profile
Re: Modeling an UML Profile with OCL Constraints
« Reply #3 on: January 30, 2010, 05:41:16 am »
Quote

A shame that.  Especially since I gather that there are some open-source OCL engines available.  I have raised an enhancement request.
Regards
David

SebastianW

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Modeling an UML Profile with OCL Constraints
« Reply #4 on: February 02, 2010, 11:32:31 pm »
I am disappointed...

The only way to solve this was that I have to develop my own EA Add-In. But that's not according to UML specification this is more an proprietary solution!

@David OD
sorry but nobody couldnīt enlighten me. And I also couldnīt find some examples that works...

@beginner
I quite agree you. EA is really checking the syntax of OCL.. no more, no less!!