Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Profile OCL validation
Profile OCL validation [message #477902] Wed, 29 October 2008 12:33 Go to next message
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
Hi.
I'd like to know the best way to check a model that applies my profile
against ocl rules defined in my profile's stereotypes.
First, if there is a way to write the ocl rules (as specified in UML
itself), debug or test it in the Profile editor. Them, when I apply the
profile, if there is a way to make the validate action read my rules.
My current way of doing this now is as follows: I don't use OCL, and have
a ATL transformation checking the model. I would like to migrate that
logic to the profile itself, but need to know the current support for
doing that.
I want to know if things like 'self.<tagname>' can be written instead of
'getValue(Stereotype,tagname)' (I mean, M1...M2...M0...Mn... )

Thanks.
Re: Profile OCL validation [message #477904 is a reply to message #477902] Wed, 29 October 2008 18:46 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Alexandre,

- You can write OCL rules as specified in the UML spec itself. Please keep
in mind that the OCL in the spec may not always be valid OCL ;)
- The easiest way to write OCL and be reassured that it works is to use the
OCL project with editor.
- Have a look at the OCL section in the following:
http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm
That will provide you with some ideas on how to integrate validation right
into your model. You can indeed simply click on "validate" and the OCL
expression attached to your models will be evaluated.

Cheers,
- James.

"Alexandre Torres" <alexandre.torres@gmail.com> wrote in message
news:bd0d40975e0c6edc2829ea7a761861d5$1@www.eclipse.org...
> Hi.
> I'd like to know the best way to check a model that applies my profile
> against ocl rules defined in my profile's stereotypes. First, if there is
> a way to write the ocl rules (as specified in UML itself), debug or test
> it in the Profile editor. Them, when I apply the profile, if there is a
> way to make the validate action read my rules.
> My current way of doing this now is as follows: I don't use OCL, and have
> a ATL transformation checking the model. I would like to migrate that
> logic to the profile itself, but need to know the current support for
> doing that.
> I want to know if things like 'self.<tagname>' can be written instead of
> 'getValue(Stereotype,tagname)' (I mean, M1...M2...M0...Mn... )
>
> Thanks.
>
>
Re: Profile OCL validation [message #477908 is a reply to message #477904] Wed, 29 October 2008 20:31 Go to previous messageGo to next message
Mauro is currently offline MauroFriend
Messages: 79
Registered: July 2009
Member
James Bruck wrote:

> - Have a look at the OCL section in the following:
>
http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm
> That will provide you with some ideas on how to integrate validation right
> into your model.   You can indeed simply click on "validate" and the OCL
> expression attached to your models will be evaluated.

could someone please produce a PDF out of this interesting but IE-only
presentation?

Mauro
Re: Profile OCL validation [message #477911 is a reply to message #477904] Thu, 30 October 2008 13:40 Go to previous messageGo to next message
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
Hi James.
>>- The easiest way to write OCL and be reassured that it works is to use the
>>OCL project with editor.

Well, they told me to come here in the first place. As I understood, there
is no way to use the ocl editor WITH the uml editor. They are concerned
with ecore queries, not with dynamic things like profiles. If there is a
presentation showing how to use this ocl editor (there is no OCL View on
my distro, just some examples that run as plugins) I would apreciate.

To tell you the truth in "my ideal world" the OCL editor would be
separated from the model, and them it can be merged to the model
generating the stand alone version. (and a reverse engineering task to
make the opposite way would be nice). Editing one by one makes hard to see
the whole. But I can't understand how the OCL project works, and my
editing was done in the UML editor , just as in your example.

>>- Have a look at the OCL section in the following:
>> http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm

Nice, but I'm doing a profile, not a class. I created the constraint and
opaque expression, applyed to a model, put wrong values on the tagged
values and it didn't work. When I redefined the profile with all options
to report, I got an odd error that points out the problem :

Classifier 'Test' should have an invariant constraint for 'validateTest'.

I tried 2 differents bodies, as opaque expressions like the presentation:

try1:
self.notTwo<>2

try2:
inv testInv: self.notTwo<>2

none worked. I noticied that in the generated UML tag, inside the GenModel
node of my Stereotype: an entry with key=documentation and value with my
body. But it doesn't work.

So, is there a downloadeble example of uml stereotype with constraints? or
at least a uml model with constraints.

validateTest is supposed to be THE invatiant constraint, can't understand
this.

Thanks
Re: Profile OCL validation [message #552920 is a reply to message #477911] Sat, 14 August 2010 14:28 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
Any news on this? I have checked some threads with this topic today. However, I could not find a concrete answer. If it already works with any tool (except Papyrus), a link or additional information is appreciated Razz

Thanks!!
Re: Profile OCL validation [message #552933 is a reply to message #552920] Sat, 14 August 2010 16:52 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Vultur

The MDT/OCL Examples in Helios provides Xtext-based editors for
CompleteOCL and OCLinEcore. These only work for Ecore meta-models.
It is planned to provide full UML support too in Indigo. This doesn't
help you now unless you use the Convert to Ecore facility so that you
can use the Ecore tooling.

Regards

Ed Willink


On 14/08/2010 15:28, vultur wrote:
> Any news on this? I have checked some threads with this topic today.
> However, I could not find a concrete answer. If it already works with
> any tool (except Papyrus), a link or additional information is
> appreciated :p
>
> Thanks!!
Re: Profile OCL validation [message #627113 is a reply to message #477902] Wed, 29 October 2008 18:46 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Alexandre,

- You can write OCL rules as specified in the UML spec itself. Please keep
in mind that the OCL in the spec may not always be valid OCL ;)
- The easiest way to write OCL and be reassured that it works is to use the
OCL project with editor.
- Have a look at the OCL section in the following:
http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm
That will provide you with some ideas on how to integrate validation right
into your model. You can indeed simply click on "validate" and the OCL
expression attached to your models will be evaluated.

Cheers,
- James.

"Alexandre Torres" <alexandre.torres@gmail.com> wrote in message
news:bd0d40975e0c6edc2829ea7a761861d5$1@www.eclipse.org...
> Hi.
> I'd like to know the best way to check a model that applies my profile
> against ocl rules defined in my profile's stereotypes. First, if there is
> a way to write the ocl rules (as specified in UML itself), debug or test
> it in the Profile editor. Them, when I apply the profile, if there is a
> way to make the validate action read my rules.
> My current way of doing this now is as follows: I don't use OCL, and have
> a ATL transformation checking the model. I would like to migrate that
> logic to the profile itself, but need to know the current support for
> doing that.
> I want to know if things like 'self.<tagname>' can be written instead of
> 'getValue(Stereotype,tagname)' (I mean, M1...M2...M0...Mn... )
>
> Thanks.
>
>
Re: Profile OCL validation [message #627117 is a reply to message #477904] Wed, 29 October 2008 20:31 Go to previous message
Mauro is currently offline MauroFriend
Messages: 79
Registered: July 2009
Member
James Bruck wrote:

> - Have a look at the OCL section in the following:
>
http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm
> That will provide you with some ideas on how to integrate validation right
> into your model.   You can indeed simply click on "validate" and the OCL
> expression attached to your models will be evaluated.

could someone please produce a PDF out of this interesting but IE-only
presentation?

Mauro
Re: Profile OCL validation [message #627120 is a reply to message #477904] Thu, 30 October 2008 13:40 Go to previous message
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
Hi James.
>>- The easiest way to write OCL and be reassured that it works is to use the
>>OCL project with editor.

Well, they told me to come here in the first place. As I understood, there
is no way to use the ocl editor WITH the uml editor. They are concerned
with ecore queries, not with dynamic things like profiles. If there is a
presentation showing how to use this ocl editor (there is no OCL View on
my distro, just some examples that run as plugins) I would apreciate.

To tell you the truth in "my ideal world" the OCL editor would be
separated from the model, and them it can be merged to the model
generating the stand alone version. (and a reverse engineering task to
make the opposite way would be nice). Editing one by one makes hard to see
the whole. But I can't understand how the OCL project works, and my
editing was done in the UML editor , just as in your example.

>>- Have a look at the OCL section in the following:
>> http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm

Nice, but I'm doing a profile, not a class. I created the constraint and
opaque expression, applyed to a model, put wrong values on the tagged
values and it didn't work. When I redefined the profile with all options
to report, I got an odd error that points out the problem :

Classifier 'Test' should have an invariant constraint for 'validateTest'.

I tried 2 differents bodies, as opaque expressions like the presentation:

try1:
self.notTwo<>2

try2:
inv testInv: self.notTwo<>2

none worked. I noticied that in the generated UML tag, inside the GenModel
node of my Stereotype: an entry with key=documentation and value with my
body. But it doesn't work.

So, is there a downloadeble example of uml stereotype with constraints? or
at least a uml model with constraints.

validateTest is supposed to be THE invatiant constraint, can't understand
this.

Thanks
Re: Profile OCL validation [message #628584 is a reply to message #477911] Sat, 14 August 2010 14:28 Go to previous message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
Any news on this? I have checked some threads with this topic today. However, I could not find a concrete answer. If it already works with any tool (except Papyrus), a link or additional information is appreciated :p

Thanks!!
Re: Profile OCL validation [message #628586 is a reply to message #552920] Sat, 14 August 2010 16:52 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Vultur

The MDT/OCL Examples in Helios provides Xtext-based editors for
CompleteOCL and OCLinEcore. These only work for Ecore meta-models.
It is planned to provide full UML support too in Indigo. This doesn't
help you now unless you use the Convert to Ecore facility so that you
can use the Ecore tooling.

Regards

Ed Willink


On 14/08/2010 15:28, vultur wrote:
> Any news on this? I have checked some threads with this topic today.
> However, I could not find a concrete answer. If it already works with
> any tool (except Papyrus), a link or additional information is
> appreciated :p
>
> Thanks!!
Previous Topic:Re: UML Testing Profile
Next Topic:Subsets and redefines code generation problem
Goto Forum:
  


Current Time: Fri Mar 29 15:44:55 GMT 2024

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

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

Back to the top