To define an extension to a step of the main success scenario, first define a handle on the step. The handle identifies the step, and can then be used to reference the step from the extension.
Then define a condition element within extensions sub-element of the use case. The condition refers to the step of the main success scenario via its handle and defines the extension to the step.
<use-case goal="Transfer funds" ...> <success> <step>User identifies debit account.</step> <step handle="credit">User identifies credit account.</step> ... </success> <extensions> <condition step-ref="credit" when="Debit and credit accounts are the same"> <step>System displays error message and lets the user identify other accounts.</step> </condition> </extensions> </use-case>
Attributes of condition:
Name | Description |
---|---|
step-ref | The value of the handle attribute of the step of main success scenario that this extension extends. |
when | The condition under which the extension applies. May alternatively be expressed using when sub-element. |
inline-step | Action of the extension. May alternatively be expressed using step sub-element(s). |
As you can see from the table above, there are alternative ways to specify the extension.
<condition step-ref="handle" when="Some condition" inline-step="Some action." />
<condition step-ref="handle" when="Some condition"> <step>Some action.</step> <step>Some other action.</step> </condition>
<condition step-ref="handle"> <when>Some condition</when> <step>Some action.</step> <step>Some other action.</step> </condition>
To extend a range of steps of the main success scenario, express the range using handle1-handle2 notation in the step-ref attribute of the condition element:
<use-case goal="Transfer funds" ...> <success> <step handle="debit">User identifies debit account.</step> <step>User identifies credit account.</step> <step handle="amount">User enters amount.</step> <step>User submits the transaction.</step> </success> <extensions> <condition step-ref="debit-amount" when="User cancels the transaction"> <step>System logs transaction failure and its reason to audit log.</step> <step>The use case processing ends.</step> </condition> </extensions> </use-case>
To extend all steps of the main success scenario, use asterisk (*) in the step-ref attribute of the condition element:
<use-case goal="Transfer funds" ...> <success> ... </success> <extensions> <condition step-ref="*" when="Client walks away at any time"> <step>User takes appropriate action...</step> </condition> </extensions> </use-case>
Each step within an extension can itself be extended, just use a step-extensions element after the step:
<condition step-ref="debit" when="User decides to verify signature"> <step>User verifies client's signature for the debit account.</step> <step-extensions> <step-condition when="Signature verification fails"> <step>The use case ends with error.</step> </step-condition> </step-extensions> </condition>
Next >> |