Thursday, November 27, 2003 01:10 AM
The problem you have is always a bit difficult with many tools, but with Rose it becomes a nightmare.
In principle, you represente an "if/then" by using a condition at the beginning of the message. A condition is presented in a guard like: [myCondition]
If you make you conditions exclusives on 2 branches you have the equivalente of an if/then/else.
For the loop it is the same notation but with a "*" at the beginning, like: *[myLoopCondition]
Your message then looks like: 1:*[i=1..10] foo()
The notation is the same for collaboration and sequence diagrams.
You can use this notation with quite a lot of tools on the market, including free ones. Unfortunately Rose, made by the company of the creators of UML, is unable to do that. Rose, at least up to its 2002 version does not offer most of the UML notation. I am dealing with this problem daily and I still do not understand why it is like this.
Also, even with a good tool, UML (at least up to version 1.4) is still not very practical for writing loops, especially when you want more than one statement in it. If you are interested, I have written an article about that question available on our web site in the "Resources/Articles" section.
I hope it helps.