Reordering messages
In sequence diagrams, you can reorder one or more messages by moving them up or down the lifeline to represent the order in which they occur. When messages are moved either up or down the lifelines, the other messages are automatically pushed up or down based on how the message is moved. When you move a single message, and if there is a message existing in the target location, then the source and the target message locations get exchanged or swapped; the source message moves to the target location and the target message moves to the source location. You can also move multiple messages in one click. When you are trying to move all the messages up or down, you must ensure that there is space for the messages to move, otherwise the movement does not happen.
Procedure
- In the lifeline, select the message that you want to move, either up or down, based on your
requirement. Moving the messages up or down can help you to create or delete extra space between the
existing messages, or swap the location of the source and target messages. For example, in the
following image, use the Move Up icon to delete the unnecessary space between
the existing messages. In the following example, if you move <message1> down, the existing <message2> will move up automatically.
- You can also move multiple message by selecting the Move Up All or
Move Down All options. For example, if you select Move Up All option, the <operation0> and <message4> messages in the given image will be moved up together.
- If you find extra spaces in between the messages due to some removal or creation of messages in
the lifelines, you can reorder all the messages in the sequence diagram by using the option
Top Align Messages. The following image shows the extra spaces in the lifeline, which you can remove by using the
Top Align Messages option.After the messages are aligned by using the Top Align Messages option, the messages look reordered as follows: