Question about activity diagram usage

Hello ,

I have a simple question about UML usage. Can I have same activity appear in different parts on my activity diagram ?
For example my diagram has activity named “doFunction” and I want to show that the same activity goes again, but somewhere else in diagram. I want to duplicate “doFunction”, so that I don’t need to pass flow of control to the same activity from different places. I want to show that the activity is executed with different states and returns flow of control to another different activities.

Hi user,

Thanks for your post. You can simply drag the activity from Model Explorer (the pane next to the Diagram Navigator) to the diagram, then you will have a view of activity on the diagram. Any change make on any view of activity will be brought to other views of activity.

Best regards,
Lilian Wong

Hi Anonymous,

Generally I would say this is something to avoid. But in the situation you have described; if the diagram includes more than one swimlane then this would be acceptable if each instance of doFunction is performed in a separate swimlane, i.e., the responsibility for executing it changes. Having said that, this additional consideration means it is no longer a ‘mere’ duplicate and therefore the name given the activity should reflect this.

You may also want to consider indicating constraints or decision elements which determine navigation or the control flows (or object flows) are activated. Also you may want to incorporate forks, joins and merge elements. This would be a more standard solution.

Good luck

Thanks for such a detailed the answer, NotNewbie. You answered the exact question that was comfusing me.