Home » Modeling » Papyrus » [SequenceDiagram] Arguments of messages
[SequenceDiagram] Arguments of messages [message #1070872] |
Thu, 18 July 2013 21:18 |
Antonio Moreno Messages: 16 Registered: November 2012 |
Junior Member |
|
|
Hi all,
A few weeks ago I posted a question about a problem related to the arguments of messages in this forum (http://www.eclipse.org/forums/index.php/m/1062312/#msg_1062312 [1]). Unfortunately, nobody replayed with an answer to my problem.
Let's assume a sequence diagram describing an interaction between two objects, namely objA, of class ClassA, and object objB, of class ClassB. Class ClassB offers an operation called anOperation with a parameter of type Boolean. During the interaction, objA sends to objB a synchronous call message to invoke the operation anOperation.
When I try to add to the message an argument of type Boolean to match the operation anOperation signature, Papyrus only allows me to add a LiteralBoolean with values true or false. I would like to write an arbitrary expression of type Boolean, e.g. self.attribA.oclIsUndefined(), but Papyrus doesn't allow me so. However, the UML 2 superstructure metamodel, as defined in the OMG specification, allows to add a value of type OpaqueExpression, that could be the previous OCL expression.
I don't want to write only a literal, but OCL expressions too. Does someone know any way to do it in Papyrus? Does someone know if this situation is a limitation of Papyrus or if I'm misunderstanding the UML metamodel?
Thanks in advance,
Antonio
|
|
|
Re: [SequenceDiagram] Arguments of messages [message #1071031 is a reply to message #1070872] |
Fri, 19 July 2013 07:40 |
Klaas Gadeyne Messages: 165 Registered: July 2009 |
Senior Member |
|
|
Hi,
Antonio M. Moreno wrote on Thu, 18 July 2013 17:18
A few weeks ago I posted a question about a problem related to the arguments of messages in this forum (http://www.eclipse.org/forums/index.php/m/1062312/#msg_1062312 [1]). Unfortunately, nobody replayed with an answer to my problem.
Let's assume a sequence diagram describing an interaction between two objects, namely objA, of class ClassA, and object objB, of class ClassB. Class ClassB offers an operation called anOperation with a parameter of type Boolean. During the interaction, objA sends to objB a synchronous call message to invoke the operation anOperation.
When I try to add to the message an argument of type Boolean to match the operation anOperation signature, Papyrus only allows me to add a LiteralBoolean with values true or false. I would like to write an arbitrary expression of type Boolean, e.g. self.attribA.oclIsUndefined(), but Papyrus doesn't allow me so. However, the UML 2 superstructure metamodel, as defined in the OMG specification, allows to add a value of type OpaqueExpression, that could be the previous OCL expression.
I don't want to write only a literal, but OCL expressions too. Does someone know any way to do it in Papyrus? Does someone know if this situation is a limitation of Papyrus or if I'm misunderstanding the UML metamodel?
It seems like you can achieve what you want via the Model explorer (ie. right-click on the message-> add child -> OpaqueExpression) --- see screenshot in attach). However, in both cases (ie. with a LiteralBoolean and with the OpaqueExpression) I do get a warning (not an error) from the validation rules, so I'm not sure I'm not missing something either...
Warning The signature of message model::Class3::Interaction1::1:Operation1_Message is an operation but the arguments of the message do not correspond to the parameters of the operation. <Message> 1:Operation1_Message model::Class3::Interaction1 EMF Problem
HTH,
Klaas
[Updated on: Fri, 19 July 2013 07:41] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 26 19:58:49 GMT 2024
Powered by FUDForum. Page generated in 0.03412 seconds
|