I'd like to visualize the following action:
Service Server
|------ping()--------->|
| |
| |
|--> |
| | sleep(10) |
|<-- |
| |
| |
response from server? |
|alt| |
|----------------------|
| no -> cancel(); |
|----------------------|
| yes -> go back to ping()
So bascially what I like to visualize is a missing response. I ping the server and when I don't get the result within a set timespan (e.g. 10 seconds) I need to do a cancel-action. If I get a result within the timespan I go back to ping().
How do I visualize it with an uml-sequence-diagram ? I just want to know how to make sure that the server is always alive as I need to perform an action when the server is offline.
Use time observation, duration observation, time constraint and duration constraint to define exact or relative timing of message receiving in your sequence diagram. For detailed information I recommend to study UML Superstructure document, Common Behaviors section.
In your example, Using this elements you can define, at which time are signals accepted by Service lifeline. If your Service will accept responding message from server within 10 seconds, it will execute go back to ping, otherwise cancel message is sent.
You can define it using standard sequence diagram or using other interaction diagram called Timing.