Perfom an action by the same actor in an UML sequence diagram

915 views Asked by At

I am new with UML and trying to draw an action made by the actor itself, and not sent to another actor. In this very simple example:

example

after receiving the code, the server has to verify if the userCode is equal to code. If this is the case, the server has to add the user to the verifiedUserList. It should be something like [userCode == code] addToVerifiedList(userid).

Is it possible to draw such a scenario or sequence diagram to concentrate only on the communication between different actors?

I am also not sure if the triangle should be filled or not. I use a REST web-server to perform POST and GET request for all the communications, is that considered as synchronous or asynchronous?

1

There are 1 answers

0
qwerty_so On BEST ANSWER

You can model it like this:

enter image description here

The alt fragment here has an ok part, where the addToVerified operation is called (a self-call). In the else part some error action is taken. And the return to the user will likely contain some informative message, which is not explicitly shown here.

The filled message arrows means, that the operation is executed synchronously. The open arrows denote asynchronous operation. I'm not that firm with HTTP protocol, but IIRC, POST/GET are both sent asynchronously and the difference is just the URL creation. Also the return message from the server will be sent asynchronously.