UML Activity diagram: decision branch ends whole activity
I was wondering if there is a way to depict that, on an activity that has a decision; one of the branches completely terminates with the activity. This would be similar to a subroutine just returning control to the invoker when a condition is met.
sub activity() {
...
...
if 开发者_开发知识库( condition ) {
...
} else {
return;//This branch finishes the activity
}
...
}
Thanks,
Carlos
The following code would look like the diagram below it.
if (D1)
{
if (D2)
{
return;
}
}
else
{
return;
}
/\ /\
o___/D1\__T____/D2\__T_______0
\ / \ / |
\/ \/ |
|____F__________________|
Note, that in this case, D2:False goes nowhere, in both the diagram and the code. I was just trying to illustrate the points that lead to the end of the activity. (note: the '0' is the end of the activity and the 'o' is the start)
精彩评论