Create Timecard Entity

This page provides directions to create the Timecard entity using RSM.

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 model explorer.
  2. Set the stereotype of the Timecard class to Entity.
  3. Add the 3 attributes as shown above.
  4. Add the findByCriteria() method as shown above. By default the method is created at instance scope. Select the method and open the General property tab and check the 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. In the General property tab uncheck Navigable for the Timecard's association end. This will make the association one-way from Timecard to Person.
  7. On the User's end of the association set the multiplicity to 1. Similarly set the multiplicity of the Timecard end to many *.
  8. On the User's end of the association type submitter in the role box. The Timecard's end does not have to be named because it is not navigable.
  9. Select the - submitter label in the diagram, and in the General property tab make this property public. This completes the submitter association from Timecard to User.
  10. 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 choosingFormat > Path Style > Rectilinear.
  11. Save your timetracker model by double-clicking on timetracker.emx and clicking on File > Save (Ctrl + S).
  12. SelectFile > Export.... Choose UML2 Model and then click onNext. As source select /TimeTracker/timetracker.emx and as destination browse to C:\timetracker\mda\src\main\uml.

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