|
Re: Accessing Message sequence number [message #700544 is a reply to message #700495] |
Sat, 23 July 2011 16:54 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Dave
I cannot see any UML facility that provides a sequence number, and I
cannot see why UML would do so since that would impose a particular
style of message header content on all UML models.
Clause 10 of the OCL Specification defines some Value classes concerned
with object history and so, if these classes were available, you might
be able to interrogate the history and queues to determine what you
want. However the OCL specification is very underspecified and
inaccurate in ths area. It provides no API to access them; indeed Value
classes are invisible to the user and so tend to be ignored by OCL
implementations. Eclipse OCL was no exception.
In one of my papers at OCL 2011,
http://gres.uoc.edu/OCL2011/pubs/ocl2011_submission_12.pdf, I identify
the benefit of realizing the Value classes and suggest that they form
the foundation for a Java binding for OCL specification. The new Eclipse
OCL implementation in the examples plugins realizes the Value classes.
However taking that further to provide history support is very low
priority, so I cannot promise anything anytime soon.
If you want message numbers, I suggest enhancing your model to include
it in your messaging.
Regards
Ed Willink
On 23/07/2011 15:59, Dave wrote:
> Hello everyone,
>
> I would like to know how to access the sequence number of an UML
> Message. In particular, I'm looking for something like
>
> msg.sequenceNumber
>
> or
>
> msg.number
>
> or something like that.
>
> I have already searched the OCL forum but have not found anything
> about it.
>
> Someone can help me, please?
>
> Many thanks in advance,
> Dave.
|
|
|
Re: Accessing Message sequence number [message #701094 is a reply to message #700544] |
Sun, 24 July 2011 16:05 |
Dave Messages: 37 Registered: September 2010 |
Member |
|
|
Hi Edward, thank you for the reply.
What about Collaboration Diagrams?
In the UML Superstructure Specification (v2.2 http://www.omg.org/spec/UML/2.2/Superstructure/PDF/, or v2.3 http://www.omg.org/spec/UML/2.3/Superstructure/PDF/) is written:
p.495:
Quote:On Communication Diagrams, the Messages are decorated by a small arrow in the direction of the Message close to the
Message name and sequence number along the line between the lifelines
and then, on p.517:
Quote:The sequence numbers show how the other messages are
sequenced. 1b.1 follows after 1b and 1b.1.1 thereafter etc. 2 follows after 1a and 1b.
Sequence expression
The sequence-expression is a dot-separated list of sequence-terms followed by a colon (':').
sequence-term '.' . . . ':'
Each term represents a level of procedural nesting within the overall interaction. If all the control is concurrent, then
nesting does not occur. Each sequence-term has the following syntax:
[ integer | name ] [ recurrence ]
The integer represents the sequential order of the Message within the next higher level of procedural calling. Messages
that differ in one integer term are sequentially related at that level of nesting. Example: Message 3.1.4 follows Message
3.1.3 within activation 3.1. The name represents a concurrent thread of control. Messages that differ in the final name are
concurrent at that level of nesting. Example: Message 3.1a and Message 3.1b are concurrent within activation 3.1. All
threads of control are equal within the nesting depth.
The recurrence represents conditional or iterative execution. This represents zero or more Messages that are executed
depending on the conditions involved...
Even so, it seems to be only a property of Messages in Collaboration Diagrams, not in Sequence Diagrams, but I hope OCL provides constructs for accessing that information, since it's contemplated in the UML specification.
I hope you can clarify that issue.
Thanks,
Dave.
|
|
|
Re: Accessing Message sequence number [message #701128 is a reply to message #701094] |
Sun, 24 July 2011 17:06 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Dave
My original answer was for dynamic message numbers.
I thought of communication diagram static message numbers later and
checked the models. There is no message number, just a dependency on
predecessors and successors, so I presume that the numbers are deduced
by ordered list analysis. You might care to look at how Papyrus handles
this; maybe they have some methods you can re-use.
Regards
Ed Willink
On 24/07/2011 17:05, Dave wrote:
> Hi Edward, thank you for the reply.
>
> What about Collaboration Diagrams?
> In the UML Superstructure Specification (v2.2
> http://www.omg.org/spec/UML/2.2/Superstructure/PDF/, or v2.3
> http://www.omg.org/spec/UML/2.3/Superstructure/PDF/) is written:
>
> p.495:
> Quote:
>> On Communication Diagrams, the Messages are decorated by a small
>> arrow in the direction of the Message close to the
>> Message name and sequence number along the line between the lifelines
>
>
> and then, on p.517:
> Quote:
>> The sequence numbers show how the other messages are
>> sequenced. 1b.1 follows after 1b and 1b.1.1 thereafter etc. 2 follows
>> after 1a and 1b.
>>
>> Sequence expression
>>
>> The sequence-expression is a dot-separated list of sequence-terms
>> followed by a colon (':').
>>
>> sequence-term '.' . . . ':'
>>
>> Each term represents a level of procedural nesting within the overall
>> interaction. If all the control is concurrent, then
>> nesting does not occur. Each sequence-term has the following syntax:
>>
>> [ integer | name ] [ recurrence ]
>>
>> The integer represents the sequential order of the Message within the
>> next higher level of procedural calling. Messages
>> that differ in one integer term are sequentially related at that
>> level of nesting. Example: Message 3.1.4 follows Message
>> 3.1.3 within activation 3.1. The name represents a concurrent thread
>> of control. Messages that differ in the final name are
>> concurrent at that level of nesting. Example: Message 3.1a and
>> Message 3.1b are concurrent within activation 3.1. All
>> threads of control are equal within the nesting depth.
>> The recurrence represents conditional or iterative execution. This
>> represents zero or more Messages that are executed
>> depending on the conditions involved...
>
>
> Even so, it seems to be only a property of Messages in Collaboration
> Diagrams, not in Sequence Diagrams, but I hope OCL provides constructs
> for accessing that information, since it's contemplated in the UML
> specification.
>
> I hope you can clarify that issue.
>
> Thanks,
> Dave.
|
|
|
Powered by
FUDForum. Page generated in 0.03326 seconds