Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » [SequenceDiagram] Arguments of messages
[SequenceDiagram] Arguments of messages [message #1070872] Thu, 18 July 2013 21:18 Go to next message
Antonio Moreno is currently offline Antonio MorenoFriend
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 Go to previous message
Klaas Gadeyne is currently offline Klaas GadeyneFriend
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

Previous Topic:How to specify flow condition in activity diagrams
Next Topic:requirements diagram problems in papyrus
Goto Forum:
  


Current Time: Thu Apr 25 06:10:07 GMT 2024

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

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

Back to the top