Frames for a set of actions or fragment of your sequence
Add to your sequence diagrams by adding more activation boxes, attaching the connectors to the lifelines (or other activation boxes) and adding the operation, parameter and return value names for each step.
You’ll quickly come across an operation that requires something a little more complex. Like a loop!
Frames can be used to indicate sets of operations, and indicating what type it is with the text in the top left.
- loop for repeated steps.
- alt for alternative steps, with as many alternative paths as you need (not just if-then-else!)
- opt or option for steps that are only performed if they meet a certain condition
- break that will exit the loop or the action if a certain condition is met.
Add the condition inside the frame next to the frame type at the top left. The frame should completely surround all of the steps needed to complete that ‘fragment’ of the sequence.