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 17:18 Go to next message
Antonio M. Moreno is currently offline Antonio M. Moreno
Messages: 13
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 03:40 Go to previous message
Klaas Gadeyne is currently offline Klaas Gadeyne
Messages: 86
Registered: July 2009
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 03: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: Wed Aug 20 20:37:50 EDT 2014

Powered by FUDForum. Page generated in 0.02177 seconds