Modelling with tasks


Task-focused Modeling 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 about Eclipse Mylyn, please visit www.tasktop.com/mylyn/). First of all, you need to install the UML Lab Mylyn Integration. Navigate to Help > Install New Software, choose the UML Lab Update Site http://update.uml-lab.com/ and then select the UML Lab Mylyn Integration plug-in. Next 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) Open the Mylyn Task List view
2) Activate your task
3) Right-click your task -> Create Context Classdiagram
4) A class diagram containing all elements belonging to the task opens
5) Done!

If you don’t have any tasks yet, please create and activate one now. Then, open some classes related to the task 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.

If you already have a Mylyn task for your project that was activated before and has some associated context, you can use this task and its context for modeling right away.

Displaying all interesting resources in a class diagram is just a single mouse click away. Just right-click your activated task and select Create Context Classdiagram from the context menu as depicted in the following figure.

Now, UML Lab will reverse engineer all interesting elements of the task's context and create a diagram for it. 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.