Book a Demo

Author Topic: Declaring a reception  (Read 5083 times)

tonyhedge

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Declaring a reception
« on: October 23, 2008, 03:50:32 am »
Sorry if I'm being dim, but I can't find any way of adding a "reception" to a class or object - ie to specify what signals it is able to receive, as per

"The OMG UML specification (UML Superstructure Specification, v2.1.1, p. 450) states:

A signal triggers a reaction in the receiver in an asynchronous way and without a reply. The sender of a signal will not block waiting for a reply but continue execution immediately. By declaring a reception associated to a given signal, a classifier specifies that its instances will be able to receive that signal, or a subtype thereof, and will respond to it with the designated behavior."

Any help would be much appreciated, but be patient - I'm just migrating to EA from Visio!

Thanks!
"Interrupts happen!"

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Declaring a reception
« Reply #1 on: October 23, 2008, 04:35:38 am »
If I understand you correctly...

Start by using a Signal element. This is (very briefly) addressed in the EA help, indexed under Signal | Element.

From there look into using a Receive element (perhaps with a send element of course), depending on the diagram type and context.

There's also a reference to this element, indexed under Receive | Element, and also look at Receive | Event.

On the Event page (mentioned in the paragraph above) you'll find a quick note about using the Advanced pad of the context menu (which comes up after you add the element and then right-click it on a diagram.

HTH, David
No, you can't have it!

tonyhedge

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Declaring a reception
« Reply #2 on: October 23, 2008, 09:48:14 pm »
Thanks, David, but I'm still struggling!

Let me explain what I'm trying to do. I'm trying to model a C++ class which can receive an Event (in something like Win32 it would be a WaitForSingleObject on an Event handle).

I'm trying to draw a Communication Diagram (ie UML Behavioural/Communication), showing the communication between an instance of this class and an instance of a class which can send such an Event.

[In my case, though its not strictly relevant, but might help if I explain, I've got a FIFO class that when it detects a particular sequence sets an event which signals to a MessageHandler class so that the MessageHandler knows it can go and read the FIFO].

In Visio, what I can do is add a "Reception" to a class. When you look at the class in the browser you will see it has a number of Attributes, Operations and Receptions. The Receptions define what Signals that class can respond to. When you then come to add a message to a Communications Diagram (or a Collaboration diagram as we used to call them!), that Signal then appears as one of the messages you can add.

I'm trying to find a similar way in EA7.1 to add the Signal to the list of messages that the class can "receive" in a Communications Diagram. I can "manually" draw an Asynchronous Signal message and give it a name (eg MsgAvail), which lets me draw the diagram, but rather defeats the idea of "modelling" the signals the class can receive.

Hope this makes sense to somebody!

Regards
Tony

"Interrupts happen!"

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Declaring a reception
« Reply #3 on: October 24, 2008, 09:14:33 am »
For a Reception, create an Operation and give it the «signal» stereotype.
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Declaring a reception
« Reply #4 on: October 24, 2008, 09:40:20 am »
Thanks for shedding more light on this Neil,

Somehow this does not seem to be documented. The EA help Index mentions only the Signal element I cite above. Searching help uncovers several more references, but still nothing quite like what you've mentioned. The closest thing is mentioning a «signal» type for a state diagram transition.

Perhaps you could pass this concern on to Roy so the documentation can be clarified (or re-indexed as appropriate).

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Declaring a reception
« Reply #5 on: October 24, 2008, 09:46:57 am »
Quote
Perhaps you could pass this concern on to Roy so the documentation can be clarified (or re-indexed as appropriate).
Done :)
The Sparx Team
[email protected]

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Declaring a reception
« Reply #6 on: October 24, 2008, 11:52:36 am »
And, in turn, Done.

In the Signal element description:

To define a reception, create an operation in the receiving object and assign the stereotype <<signal>> to it. The reception has the same name as the signal that the object can receive.

Indexed under Reception.

Changes available with the release of build 834.
Best Regards, Roy

tonyhedge

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Declaring a reception
« Reply #7 on: October 24, 2008, 08:59:04 pm »
Thanks guys - just tried it and that does exactly what I was trying to do.

Excellent support!

Regards
Tony
"Interrupts happen!"