Create Timecard Entity

This page provides directions to create the Timecard entity using MagicDraw 16.5.

Follow the steps below to create the Timecard entity along with the two associations.

  1. Open the diagram called "Domain Objects" and create a class called Timecard in it. Make sure the class is created in the org.andromda.timetracker.domain package by inspecting the containment tree.
  2. Set the stereotype of the Timecard class to Entity.
  3. Add the 3 attributes as shown above. Remember to uncheck the Is Unique box.
  4. Add the findByCriteria() method as shown above. By default the method is created at instance scope. Double-click on the method to open the Operation Specification dialog box and check the Is Static box.
  5. Select the association relationship from the toolbar. Use the tool tips and the status bar to identify the association tool. Create an asociation from Timecard to User.
  6. Right-click on the Timecard end of the association and uncheck Navigable. This will make the association one-way from Timecard to Person.
  7. Right-click on the User end of the association and select the multiplicity of 1. Similarly set the multiplicity of the Timecard end to many (*).
  8. Right-click on the User end of the association and select Edit Name. Type the following specification for this association end: "+submitter". The Timecard end does not have to be named because it is not navigable. This completes the submitter association from Timecard to User.
  9. Similarly add an approver association from Timecard to User. Move the associations up or down as appropriate so they do not overlap each other. This can be made easier by right-clicking on the association and choosing Path Style > Rectilinear.
  10. Save your timetracker model by selectingFile > Save Project.
  11. Export it in EMF/UML2 format by selectingFile > Export > EMF UML2 (v2.x) XMI File. Choose C:/timetracker/mda/src/main/uml as export directory and clickExport.

Now go back to the main tutorial page and continue from where you left off.