Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Message Arguments
Message Arguments [message #1005538] Sat, 26 January 2013 04:32 Go to next message
Andrea Sindico is currently offline Andrea Sindico
Messages: 266
Registered: November 2010
Senior Member

The UML spec 2.5b1 says for Messages

If the messageSort is either synchCall or asynchCall, then the Message represents the synchronous or asynchronous call to and start of execution of the Operation. The arguments of the Message correspond to the in and inout ownedParameters of the Operation, in the order of the ownedParameters.
An argument of a Message is a ValueSpecification. If the Message has a signature and it is not a reply Message, then its argument ValueSpecifications are considered to be evaluated at the point of the send event of the Message. Their results provide the values for the corresponding Operation input parameters or Signal attributes. However, an argument consisting of an Expression with no operands and the empty string as its symbol has a special interpretation as a wildcard, corresponding to an unspecified but legal value for the corresponding parameter or attribute. Otherwise, the type of the argument must conform to the type of the corresponding parameter or attribute.


Now consider this pseudocode

ClassA {
  ClassB b;
  public void   classAOperation(int param){
     if (param>0){
          b.classBOperation(param);
     }else{
          b.classBOperation(0);
     }
  }
}


I managed to represent it by means of a Sequence Diagram
http://www.eclipse.org/forums/index.php/t/447570/

it consists of a Message Synch starting from a formal gate and ending to the self lifeline represeneting the ClassA instance with the classAOperation signature. It is followed by an IF Fragment conditioned on the param value. In the first Operand the classBOperation is invoked passing param as parameter while in the second Operand the same operation is invoked but with 0.

My question is how should I define the arguments for each of these messages. Basically my concern is about the fact I have seen Arguments are ValueSpecification and I don't know how to use them in case of variables (param)


Follow me on Twitter @andreasindico

Re: Message Arguments [message #1005549 is a reply to message #1005538] Sat, 26 January 2013 08:19 Go to previous messageGo to next message
Eclipse User
Hi Andrea,

I'd like to see your sequence diagram, would you be so kind to post it?

Some remarks to your comments:

>it consists of a Message Synch starting from a formal gate
Due to the loose semantics of gates, I never used them. Gates caused the UML
2.5 Interactions team (that includes me) a lot of troubles, since they are
difficult to treat in the proper way. Anyway, you would not need a gates for
your scenario, just define a found message; this is somehow "state of the
art" (meaning, I've seen mainly this approach in literature and the real
world) in sequence diagrams, when the user wants to express that the self
lifeline is somehow involked at the very beginning.

>and I don't know how to use them in case of variables (param)

Short answer! This is not possible without OCL! Interactions do not offer
the possibility to select parameter or variables for further messages or
invocations. I know, this is very strange. This has been reported to the UML
RTF a long time ago, but has not been solved yet
(http://www.omg.org/issues/uml2-rtf.open.html#Issue8761).

With OCL and OpaqueExpression you would be able to express a navigation
expression for the parameter, although I do know that this is much to
complicated for such a fundamental thing. I'm confident to resolve this in
UML 2.5 or 2.6, let's see. For now, you would need to use a workaround.

Marc-Florian


"Andrea Sindico" schrieb im Newsbeitrag
news:ke07qp$eg3$1@xxxxxxxxe.org...

The UML spec 2.5b1 says for Messages

If the messageSort is either synchCall or asynchCall, then the Message
represents the synchronous or asynchronous call to and start of execution of
the Operation. The arguments of the Message correspond to the in and inout
ownedParameters of the Operation, in the order of the ownedParameters.
An argument of a Message is a ValueSpecification. If the Message has a
signature and it is not a reply Message, then its argument
ValueSpecifications are considered to be evaluated at the point of the send
event of the Message. Their results provide the values for the corresponding
Operation input parameters or Signal attributes. However, an argument
consisting of an Expression with no operands and the empty string as its
symbol has a special interpretation as a wildcard, corresponding to an
unspecified but legal value for the corresponding parameter or attribute.
Otherwise, the type of the argument must conform to the type of the
corresponding parameter or attribute.

Now consider this pseudocode


ClassA {
ClassB b;
public void classAOperation(int param){
if (param>0){
b.classBOperation(param);
}else{
b.classBOperation(0);
}
}
}

I managed to represent it by means of a Sequence Diagram
http://www.eclipse.org/forums/index.php/t/447570/

it consists of a Message Synch starting from a formal gate and ending to the
self lifeline represeneting the ClassA instance with the classAOperation
signature. It is followed by an IF Fragment conditioned on the param value.
In the first Operand the classBOperation is invoked passing param as
parameter while in the second Operand the same operation is invoked but with
0.

My question is how should I define the arguments for each of these messages.
Basically my concern is about the fact I have seen Arguments are
ValueSpecification and I don't know how to use them in case of variables
(param)

--
Follow me on Twitter @andreasindico
Re: Message Arguments [message #1005554 is a reply to message #1005549] Sat, 26 January 2013 12:00 Go to previous message
Andrea Sindico is currently offline Andrea Sindico
Messages: 266
Registered: November 2010
Senior Member

Hi Marc-Florian,
thank you for your kind answer.
Ok for found messages instead of gates.
It's amazing to see someone pointed out the same issue in 2005.

Regards

Andrea


Follow me on Twitter @andreasindico

Previous Topic:Sequence Diagrams
Next Topic:how reverse engineering ?
Goto Forum:
  


Current Time: Fri Jul 25 19:13:02 EDT 2014

Powered by FUDForum. Page generated in 0.05669 seconds