Modelling with tasks


Task-focused modelling with UML Lab and Mylyn

Mylyn keeps you focused on the resources that are most important for your current development task. UML Lab’s task-focused modeling capabilities bring this groundbreaking concept to your modeling projects. This tutorial shows you how to profit from an even clearer view on your project when working with diagrams.

With its Mylyn integration, UML Lab helps you stay focused on what’s important. No matter if you’re working with existing tasks and projects or starting fresh, it just takes you a few clicks to benefit from task focused modeling.


This tutorial assumes some basic knowledge about Mylyn (for further information on Mylyn, visit www.tasktop.com/mylyn). First of all, you will need a project containing some classes to work with (to quickly get an example project, select File / New / Example... / UML Lab Shop Example).

Scenario 1: Your task context in a diagram

Quick start:
1) activate your task
2) right-click on your task -> Create Context Classdiagram
3) class diagram containing all elements belonging to the task opens
4) done!

If you already have a Mylyn task for your project, you can continue using its context for modeling right away. Displaying all interesting resources in a class diagram is just a single mouse click away.

If you don’t have any tasks yet, please create and activate one now. Open some classes in the Java editor, select some elements or make some changes. This tells Mylyn which elements are of interest to you in this task, making them show up in filtered views and editors.

Now just right-click on your activated task and select Create Context Classdiagram from the context menu. UML Lab will reverse engineer all interesting elements and create a diagram for the active task. That’s it! You can now continue working on your project, while Mylyn continues to keep you focused on the important things – both in your diagrams and your code.

Scenario 2: associate existing diagrams with your task

Quick start:
1) activate a Mylyn task
2) open your class diagram
3) activate the button Focus Diagram and add new elements
4) in the UML Lab Tree View, pick the classes you want in your task
5) the selected elements are now associated with your task, i.e. they form the diagram’s task context

UML Lab will add any existing diagram to the active task, as soon as you open and start working on it. If you already have diagrams of your own in your project, all you have to do is open them while the desired task is active.

Activate the Focus Diagram button to only see the interesting elements for your task. Notice that the diagram may be empty at first, if your task does not yet contain any elements. You can simply continue working, Mylyn’s task context will update itself automatically. For Mylyn, elements will become more interesting and show up in the diagram the more you work on them – either in the model or in the code - whereas others that you haven’t touched in a while will disappear over time.

Turn task-focusing on/off in your diagram

The Focus Diagram button activates the task-focused presentation mode for your diagram. As long as it is not active, the diagram will not be filtered. You can choose between two focusing modes:

  • Focus diagram will hide all diagram elements that are not interesting for the active task. Only elements already found in the unfocused diagram will be displayed. New interesting elements will not be added automatically.
  • Focus Diagram and add new elements behaves similarly to Focus Diagram. But in addition, all elements will be shown in the diagram as soon as they become interesting, no matter if they were part of it before. This is the standard behavior for task context diagrams.

So, which one should you use? Since diagrams often represent a clearly outlined aspect of a system, it may be undesirable to have all new elements of interest added to them. This is where Focus Diagram will make most sense. If your diagram, however, does not represent a distinct aspect of your system, consider using the second mode, through which all new interesting elements will be added to the diagram. Task context diagrams, as mentioned before, always use the second mode.

By the way: working with Mylyn will not affect your diagram’s original, unfocused layout. As soon as you turn off focusing, the original layout of your diagram will be restored.