| Constraint XOR [message #871494] |
Mon, 14 May 2012 04:45  |
Augusto Ribeiro Messages: 5 Registered: April 2010 |
Junior Member |
|
|
Hi all,
Sorry for asking such a basic question, I am new to both Papyrus and UML but I need to know if it is possible to model this in Papyrus and if yes, how to do it. I attached a picture with the part of the model I need to model.
I have to leave the link like this because I cannot post hyperlinks:
imageshack.us/photo/my-images/151/constraint.png
Thanks in advance,
Augusto
Augusto Ribeiro
Aarhus School of Engineering
[Updated on: Mon, 14 May 2012 04:46] Report message to a moderator
|
|
|
|
| Re: Constraint XOR [message #872028 is a reply to message #872007] |
Tue, 15 May 2012 06:39   |
Augusto Ribeiro Messages: 5 Registered: April 2010 |
Junior Member |
|
|
Hi Camille,
Thanks for your answer but from what I gather Enumerations can only contain literals. What I want to represent is that "gender" attribute can be of type Male or Female (which are classes), or bool (a primitive type). This is somehow similar to union types in C "en.wikipedia.org/wiki/Union_(computer_science)". Therefore the XOR constraint, constraining the "gender" attribute to be only one of those types (Male, Female or bool).
The example I gave is valid UML and done in Enterprise Architect, I would like to know if it possible to do the same with Papyrus and how.
Best regards,
Augusto
Augusto Ribeiro
Aarhus School of Engineering
[Updated on: Tue, 15 May 2012 06:40] Report message to a moderator
|
|
|
|
|
| Re: Constraint XOR [message #902060 is a reply to message #872114] |
Wed, 15 August 2012 13:12  |
Andrea Messages: 27 Registered: July 2009 |
Junior Member |
|
|
On 05/15/2012 03:43 PM, Camille Letavernier wrote:
>
> - Create your classes and primitive types
> - Draw your "gender" associations
> - Add a Constraint to your diagram
> - Add a Link between the constraint and each association
>
I'm not sure what I'm doing wrong, but I can't quite follow the steps
described here. The constraint editor doesn't allow me to just specify
the word xor, like it is done in the picture. I would assume that it
doesn't consider it valid OCL.
I'm not sure if the keyword "xor" alone is valid OCL, but for what I
know a constraint can also contain plain text, so anything should be fine.
Is there anything I can do to change this behavior?
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.01731 seconds