Skip to main content


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 15:11 Go to next message
DavidH Mising name is currently offline DavidH Mising nameFriend
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 16:42 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
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 25 20:17:47 GMT 2024

Powered by FUDForum. Page generated in 0.02967 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top