Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » OCL constraints creation(how to use OCL constraints in profile definiton process)
OCL constraints creation [message #669837] Wed, 11 May 2011 18:27 Go to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: May 2011
Junior Member
Hi everyone,

I am creating a UML profile with papyrus and I don't understand how to attach OCL constraints to the model stereotypes. I am looking for information but I haven't found any.

I now how to attach a constraint element to the model but I can't understand how to fill the fields in the "Properties View" in order the validation of the constraints works correctly in the later process of profile application.

If anyone knows about any documentation which can helps me or he/she can help me yourself, please let me know.


Thanks in advance!

Natalia
Re: OCL constraints creation [message #670011 is a reply to message #669837] Thu, 12 May 2011 12:15 Go to previous messageGo to next message
Thomas Neustupny is currently offline Thomas NeustupnyFriend
Messages: 75
Registered: October 2009
Member
Hi Natalia,

there is a thread on this topic (it's relevant for Papyrus because Papyrus uses eclipse UML2/EMF):
http://www.eclipse.org/forums/index.php/t/206602/

The relevant statement from a UML2 developer probably is:

"Support for dynamically evaluating stereotype (or other) constraints will not
be provided (at least not in UML2) since this would introduce a circular build
dependency on MDT OCL. Besides, this a tool-level capability that would be more
appropriately provided by the UML2 Tools component of MDT (seeing as it already
depends on both UML2 and OCL)." (Kenn Hussey)

But I can't tell how/if Papyrus provides that feature.

[Updated on: Thu, 12 May 2011 12:18]

Report message to a moderator

Re: OCL constraints creation [message #670126 is a reply to message #670011] Thu, 12 May 2011 17:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Thomas

This seems to be a Papyrus limitation. I would expect to see a
"Validate" menu option so that Papyrus behaves in a similar way to the
Ecore tree editors. This option seems to be missing.

"Validate" should trigger the invocation of your OCL constraints by the
Papyrus framework. The framework should convert your UML model to Ecore
where the OCL constaints are installed as delegates for activation
within the EMF validation framework.

Two days ago, we got a first demonstration working of integration of the
Essential OCL Xtext editor for constraints within Papyrus; hopefully
this will be available in the Indigo release. This integration
demonstrates that Eclipse OCL now has the functionality to exploit UML
models, so what you want may be possible soon; can't make any promises
for Indigo since we're just starting the release candidate run-down.

Regards

Ed Willink

On 12/05/2011 13:15, Thomas Neustupny wrote:
> Hi Natalia,
>
> there is a thread on this topic (it's relevant for Papyrus
> because Papyrus uses eclipse UML2/EMF):
> http://www.eclipse.org/forums/index.php/t/206602/
>
> The relevant statement from a UML2 developer probably is:
>
> "Support for dynamically evaluating stereotype (or other)
> constraints will not
> be provided (at least not in UML2) since this would
> introduce a circular build
> dependency on MDT OCL. Besides, this a tool-level capability
> that would be more
> appropriately provided by the UML2 Tools component of MDT
> (seeing as it already
> depends on both UML2 and OCL)." (Kenn Hussey)
Re: OCL constraints creation [message #672402 is a reply to message #670126] Fri, 20 May 2011 22:28 Go to previous messageGo to next message
Sébastien Gérard is currently offline Sébastien GérardFriend
Messages: 121
Registered: July 2009
Senior Member
HI,

The xtext editor of authoring UML constraint in OCL has been committed in Papyrus.
Now, we need to have this validate button as mentioned by Ed. Ed, an idea on how to do it?

Sébastien.
Re: OCL constraints creation [message #672455 is a reply to message #672402] Sat, 21 May 2011 04:58 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI Sebastien

Yes. As a first pass, just 'borrow' the Validate button from the UML
Model editor. This will give a pop-up that at least reports the
problems. Just possible for Indigo. At least the infrastructure would be
there, facilitating enhancement in Indigo SR1. Even if Papyrus is
perfect, I think I can promise at least a minor issue with the OCL.

Then, support visual feedback; little red/yellow error/warning
decorations on the icons of all offending blocks, and on the centre of
each offending line. I did this in GEF for the UMLX editor and it looks
really good. But it does require an icon per symbol to decorate, which
is what the Ecore Diagram and UML2 Tools visual styles provide. See the
last figure in
http://www.eclipse.org/gmt/umlx/doc/GT-VMT2006/GTVMT2006.pdf or
http://www.eclipse.org/gmt/umlx/doc/GraMoT2006/GraMoT2006.pdf.
(Frightening, 5 years on and I'm still working on the infrastructure to
get UMLX working properly.)

And also, but it might happen for free, navigation from the problem view
markers back to the relevant diagram element.

Regards

Ed Willink



On 20/05/2011 23:28, Sebastien Gerard wrote:
> HI,
>
> The xtext editor of authoring UML constraint in OCL has been committed
> in Papyrus.
> Now, we need to have this validate button as mentioned by Ed. Ed, an
> idea on how to do it?
>
> Sébastien.
Re: OCL constraints creation [message #672481 is a reply to message #672455] Sat, 21 May 2011 09:03 Go to previous messageGo to next message
Sébastien Gérard is currently offline Sébastien GérardFriend
Messages: 121
Registered: July 2009
Senior Member
Ok, I will look at that next week. however, we aleaready enable to use emf validation within Papyrus and have associated makers in both the model browser and diagram editor.
Re: OCL constraints creation [message #672521 is a reply to message #672481] Sat, 21 May 2011 15:08 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Sebastien

Excellent, you've already done the hard bits. Just need an interactive
menu button to invoke it. I think the EssentialOCL validation might just
work.

If you want to facilitate Complete OCL documents too, you would need to
maintain a list of *.ocl resource names and install each for use by
constructing a UML variant of CompleteOCLEObjectValidator for each list
entry. If you're able to do the name list, I could provide the UML variant.

Regards

Ed Willinkl

On 21/05/2011 10:03, Sebastien Gerard wrote:
> Ok, I will look at that next week. however, we aleaready enable to use
> emf validation within Papyrus and have associated makers in both the
> model browser and diagram editor.
Previous Topic:where to download the latest release
Next Topic:Papyrus class diagram to ecore format
Goto Forum:
  


Current Time: Fri Apr 19 10:03:38 GMT 2024

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

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

Back to the top