Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » How/Can an OCL expression access a UML Class Diagram?(Need to check for existence of a named Class Diagram in a UML Model)
How/Can an OCL expression access a UML Class Diagram? [message #1184602] Wed, 13 November 2013 10:11 Go to next message
DavidH Mising name is currently offline DavidH Mising name
Messages: 3
Registered: April 2011
Junior Member
I'm writing OCL expressions to validate a UML model. One thing I'd like to do is check the model for the existence of a specifically named UML Class Diagram. Is that possible?

I have a modeling rule that says for certain types of Classes, modelers must create a corresponding UML class diagram of the same name. I'd like to enforce that decoratively with OCL.

Thanks!

D
Re: How/Can an OCL expression access a UML Class Diagram? [message #1184718 is a reply to message #1184602] Wed, 13 November 2013 11:42 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 701
Registered: July 2009
Senior Member
Hi, D,

You might try something like

context uml::Class
inv: self.<whatever-identifies-the-special-class-type> implies
notation::Diagram.allInstances()->exists(element = self)

but that depends on what the scope of 'allInstances' is. In Papyrus,
for example, it would have to be the ResourceSet because Papyrus stores
the diagram content in a different resource than the UML content.

HTH,

Christian


On 2013-11-13 15:11:32 +0000, DavidH Mising name said:

> I'm writing OCL expressions to validate a UML model. One thing I'd like
> to do is check the model for the existence of a specifically named UML
> Class Diagram. Is that possible?
>
> I have a modeling rule that says for certain types of Classes, modelers
> must create a corresponding UML class diagram of the same name. I'd
> like to enforce that decoratively with OCL.
>
> Thanks!
>
> D
Previous Topic:installing MDT OCL
Next Topic:Miguel Garcia
Goto Forum:
  


Current Time: Thu Apr 17 23:49:05 EDT 2014

Powered by FUDForum. Page generated in 0.01801 seconds