Home » Modeling » UML2 » Profile OCL validation
|
Re: Profile OCL validation [message #477904 is a reply to message #477902] |
Wed, 29 October 2008 18:46 |
james bruck 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 #477911 is a reply to message #477904] |
Thu, 30 October 2008 13:40 |
Alexandre Torres 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 #627113 is a reply to message #477902] |
Wed, 29 October 2008 18:46 |
james bruck 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 #627120 is a reply to message #477904] |
Thu, 30 October 2008 13:40 |
Alexandre Torres 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
|
|
| | |
Goto Forum:
Current Time: Thu Sep 26 04:22:51 GMT 2024
Powered by FUDForum. Page generated in 0.04460 seconds
|