Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352466 - [TMF] Implement UML2 Sequence Diagram Framework
Summary: [TMF] Implement UML2 Sequence Diagram Framework
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LinuxTools (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Bernd Hufmann CLA
QA Contact: Francois Chouinard CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-19 10:37 EDT by Bernd Hufmann CLA
Modified: 2022-01-13 14:53 EST (History)
2 users (show)

See Also:


Attachments
Contribution of a Sequence Diagram Framework (1.68 MB, patch)
2011-07-20 13:56 EDT, Bernd Hufmann CLA
jjohnstn: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Hufmann CLA 2011-07-19 10:37:35 EDT
It would be useful to add a UML2 Sequence Diagram Framework to TMF. This framework shall provide:

- UML2 sequence diagram drawing capabilities (i.e. lifelines, messages, activations, object creation and deletion)
- Generic, re-usable sequence diagram view 
- Eclipse Extension Point for the creation of sequence diagrams 
- Callback hooks for searching and filtering within the sequence diagram view
- Scalability

The idea is have the capability to draw any type of UML2 sequence diagrams based on data retrieved from a trace.

Typically, a trace tool based on TMF would scan the trace, analyse the events to determine all necessary information for UML2 sequence diagrams (e.g. sender, receiver, signal) and load that information into the sequence diagram.

This will be very powerful when using it in combination with other features of TMF, for example view synchronization. By selection an event in the sequence diagram view other views can be notified to show the corresponding event in their view.

Examples for the usage of the framework are:
- Internode communication of multiple nodes
- Interprocess communication
- Call-flow within a object-oriented software component
Comment 1 Bernd Hufmann CLA 2011-07-20 13:56:46 EDT
Created attachment 200030 [details]
Contribution of a Sequence Diagram Framework

This patch provides an implementation of a Sequence Diagram Framework.

General
=======
Drawing capabilities are based on the archived Eclipse-TPTP's UML2SD plug-ins
* It provides UML2 drawing capabilities
    - Lifeline
    - Asynchronous Message / Message Return
    - Synchronous Message / Message Return
    - Activation
    - Object creation and end
* Provides generic Eclipse view which can be re-used 
* Provides many interfaces (callback hooks) for
    - Searching (simple and advanced)
    - Filtering (simple and advanced)
    - Paging (simple and advanced) 
    - Collapsing of lifelines
* Provides default features 
    - Zooming
    - Printing
    - Preferences for view customization
* Provides an extension point (uml2SDLoader) for loading of the sequence diagram view with content

The solution is integrated in plug-in TMF UI (org.eclipse.linuxtools.tmf.ui) and adapted to TMF specifics:
* TmfTimestamps
* TmfTimeRanges

Reference implementation
========================
Additionally, a reference implementation of the uml2SDLoader has been included in TMF UI under the package org.eclipse.linuxtools.tmf.ui.views.uml2sd.impl and name TmfUml2SDSyncLoader. The extension point definition in TMF UI associates this loader class with the sequence diagram view org.eclipse.linuxtools.tmf.ui.tmfUml2SDSyncView which is also defined in TMF UI. 

This reference loader implementation provides among others the following features:
* Ability to parse a TMF event for the following event type and field:
    - Event Type: SEND, RECEIVE
    - Fields: sender, receiver, signal
* Ability to use the above date to load the sequence diagram view with lifelines and synchronous messages
* Ability to search forward based on regular expression
* Ability to filter interactions or lifelines based on regular expressions
* Ability to display a fixed number of events (10000) per page at a time for scalability reasons (paging)
* Ability to synchronize with other TMF based views (i.e. synchronize a current time, synchronize to a new time range)
* Ability to inform other TMF based views about new current time or time range

Please note that this reference implementation can be used for a trace tool based on TMF as is, if the trace provide the above event types and fields and can be parsed as follows:
protected ITmfSyncSequenceDiagramEvent getSequnceDiagramEvent(TmfEvent tmfEvent) {
        //type = .*RECEIVE.* or .*SEND.*
        //content = sender:<sender name>:receiver:<receiver name>,signal:<signal name>
        String eventType = tmfEvent.getType().toString();
        if (eventType.contains("SEND") || 
                eventType.contains("RECEIVE")) {
            try {
                Object sender = tmfEvent.getContent().getField("sender");
                Object receiver = tmfEvent.getContent().getField("receiver");
                Object name = tmfEvent.getContent().getField(signal);
                if ((sender instanceof TmfEventField) && (receiver instanceof TmfEventField) && (name instanceof TmfEventField)) { 
                    ITmfSyncSequenceDiagramEvent sdEvent = new TmfSyncSequenceDiagramEvent(tmfEvent, 
                            ((TmfEventField)sender).getValue().toString(), 
                            ((TmfEventField)receiver).getValue().toString(), 
                            ((TmfEventField)name).getValue().toString());

                    return sdEvent;
                }
            } catch (TmfNoSuchFieldException e) {
            } 
        }
        return null;
    }

Limitation of Reference implementation
======================================
The reference loader implementation has the Limitation:
The traces have to be collected at one component (either receiving component or sending component). There is no correlation mechanism implemented to correlate messages within traces of the receiving and sending side. 

Documentation
=============
Documentation about the Sequence Diagram Framework will be provided soon.
See also extension point schema.
Comment 2 Bernd Hufmann CLA 2011-07-20 15:30:46 EDT
Comment on attachment 200030 [details]
Contribution of a Sequence Diagram Framework

Patch committed!
Comment 3 Francois Chouinard CLA 2011-07-22 15:29:54 EDT
Planned for 0.8.1
Comment 4 Andrew Overholt CLA 2011-08-15 14:35:43 EDT
Is this suitable for a bug-fix release (0.8.1) or should the Target Milestone be set to 0.9.0?
Comment 5 Andrew Overholt CLA 2011-08-15 14:36:48 EDT
Sorry, I meant to ask if this has been cherry-picked to stable-0.8.
Comment 6 Francois Chouinard CLA 2011-08-16 09:17:02 EDT
This is a brand new feature.
Comment 7 Bernd Hufmann CLA 2011-08-29 10:58:38 EDT
I've created a User/Design Guide for the Sequence Diagram Framework. Use the following link to access the wiki page: 

http://wiki.eclipse.org/Linux_Tools_Project/TMF/User_Guide
Comment 8 Francois Chouinard CLA 2012-03-26 13:51:32 EDT
Delivered in 0.9.0