tags:

views:

27

answers:

1

My team is using Rational Software Modeler to build some UML diagrams. Each diagram has a little text box stating a human-readable title, the last-modified date, and some other information about the diagram.

Is there a way to automatically keep the last-modified date up to date? A macro, perhaps? Or some sort of plugin to Eclipse?

A: 

You most certainly can update this information any time the diagram is saved. A plug-in will do this. The solution will be a GMF and EMF (UML ecore model) solution. I have written a similar plug-in that listens for model or object changes and then updates a UML object.

High-level approach.

  1. Create a eclipse plug-in, you may want to include com.ibm.xtools.modeler...
  2. Add a listener to the GMF diagram (Notification Listener) or create a (in GMF, EditPolicy/EditPart). This way every time it changes then you update the time stamp, you might also consider waiting/listening for a save command so save on extra ecore transactions.
  3. Write a transaction by extending a class like RecordingCommand. Then find all the child nodes on the diagram that match what you are looking for, personally I would use a UML profile and lock down the contents of the notes and/or automate it, but it could be left free form.
  4. Have the listener or EditPolicy execute the transaction before the save or edit completes, which ever you chose.

There are GMF and EMF tutorials out there and books, not extensive, but tough going. If you are really hard up direct message me asking the more detailed question or add it here and ping me, if you are still in need of this 7 months late, your question is very specific.

Ted Johnson