(Actually, Lock ‘n’ Commit…)
I opened a Teamwork (that is, shared) project from the MagicDraw Teamwork Server, but I couldn’t do much until I locked the elements I wanted to modify. When I right-clicked the diagram in the containment tree though, there was a Lock for Edit and a Lock for Edit Content:
Which should I choose?
MagicDraw provides a very fine-grained locking mechanism — there is a separate lock for each model element (class, method, property…) and each symbol element (diagram, class symbol, sequence diagram lifeline, note, class symbol, line of association…) If you’re going to be changing several things though, it really breaks the flow to keep having to lock things one by one.
When Editing a Diagram, Use Lock for Edit Content
That’s where Lock Content and Lock Recursively come in. At the diagram level, Lock for Edit only locks the diagram element itself, not everything on the diagram. So what I generally want is Lock for Edit Content there.
When Locking at the Folder Level, Use Lock Recursively
Later this week I was working on several sequence diagrams depicting different aspects of the same classes in the model. Rather than lock each new class in the model separately, I wanted to lock at the folder level. Right-clicking the folder in the containment tree, I can choose Lock Recursively to lock everything in the folder:
(Plain “Lock for Edit” would only lock the folder element itself, which is not what I generally need.)
Saving and Locks
To my current knowledge, saving a teamwork project means commiting your changes back to the teamwork server — I don’t think there’s a notion of a local working copy as there is with CVS or Subversion; I think the changes are all in memory until you commit.
By default, when you commit your changes you don’t release any locks that you have on the elements. To do that, on the Commit Settings dialog you go to the Locked Elements tab and select the elements you want to unlock on commit (normally “All”):