Building the perfect activity diagram - guidance on loops and more

Hello,

I’m seeking some advice on drawing Activity diagrams, but as a new user of both Visual Paradigm and UML, I am often unsure how to connect the missing pieces.

I’ve drawn a fairly simple activity diagram (first attachment). The very first problem is my use of loops and conditionals. Right now, I just used Decision nodes. This isn’t too bad for 'if’s, but doesn’t look correct for loops.

Also, any particular activity may have generic tasks (such as reading a file). I am confused as to how I diagram this “sub-diagram”. As you see from my output, I am clearly doing something wrong as VP won’t let me connect things up with control lines.

Finally, I’ll continue to search around, but I either find resources not specific to VP where I can’t map the concepts to VP usage, or VP-specific materials that don’t seem to be advanced enough what what I’m doing (or may indicate I need to adjust my usage). If anyone could offer advice or pointers, I would appreciate it.

Regards.

simple.jpg


fileReader.jpg

with loops.jpg

Hello Robert,

According to your description, I think you should use the Expansion Region to model the loop condition. According to UML specification, the Expansion Region is a strictly nested region of an activity with explicit input and outputs (modeled as ExpansionNodes). Each input and output is a collection of values. The Expansion Region allows to set to different mode, i.e. parallel, iterative and stream. Setting the mode to iterative will best suit your requirement. Attached is a small sample showing how the Expansion Region works. In the example, after receiving the order, it will pass the order details into Expansion Region and to process the order details one by one. And after the process was done (all data in input has been processed), then pass the output out of the Expansion Region for continue the process. The squares attached to the Expansion Region are called Expansion Node (which mentioned above).

And for the generic task, you can model it inside and activity so that it can be reuse in different diagrams.

Hope this helps. If you need any help, please do not hesitate to contact me again.

Best regards,
Rain Wong


Activity Diagram1.png