Model parametrized API Call in Activity Diagram

Viewed 2053

I have an an activity diagram with two swimlanes (Client and Server). I want to model a request call from Client to Server.

  1. Is it correct to use Signals Notation for Calls between systems? Are there alternatives?
  2. The call is parametrized, Client wants to send something which was created before. How to model this?

Thankful for any hint! Here's my example: link

3 Answers

My answer has to be improved, but here is a first step.

The norm/spec says: "A SendSignalAction is an InvocationAction that creates a Signal instance and transmits the instance to the object given on its target InputPin. A SendSignalAction must have argument InputPins corresponding, in order, to each of the (owned and inherited) Properties of the Signal being sent, with the same type, ordering and multiplicity as the corresponding attribute.

And a SendSignalAction has an association to a target objet which is an input pin.

So for your question about Request:item I would use input pin, one for the object from which the Signal is created and one to define the Target. (in the schema the target comes from an output pin but a data store may be use). Then after sending the request, the client is waiting the answer. The AcceptEvent is linked to a trigger (not shown on the schema) which a signal, the one created by the server. But you can not link SendRequest of Client to ReceiveRequest of Server because this is not how it runs.

For the server, you can do similar reasoning.

enter image description here

Concerning the parametrization of the call I would use InputPin to model the arguments of the Call i.e. the Object sent by the Call as shown below. enter image description here

Signal and Call Notations are correct for me but I am not used to have the sending and receive action in the same diagram so will suggest two alternatives. 1) First remove them... enter image description here

2) Separate Client and Server Modelling enter image description here enter image description here

Let me know what you think about that and what seems to be clear for you... I also recognize the tool you used so please find my project at:

https://www.dropbox.com/s/s1mx46cb3linop0/Project1.zip?dl=0

As I see it, it should be modeled like this:

enter image description here

The server runs in an independent loop and starts with waiting for a request. There's a object flow between Create request and Query result set. This symbolizes data placed in a queue (or what ever is appropriate). The receipt of the result set would be done below in a similar way, I just left that out for brevity.

You can also draw an object for the query set

enter image description here

instead of the ActionPins.

Related