| Summary: | [TMF] Implement UML2 Sequence Diagram Framework | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Bernd Hufmann <bernd.hufmann> | ||||
| Component: | LinuxTools | Assignee: | Bernd Hufmann <bernd.hufmann> | ||||
| Status: | CLOSED FIXED | QA Contact: | Francois Chouinard <fchouinard> | ||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | jjohnstn, overholt | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Bernd Hufmann
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 on attachment 200030 [details]
Contribution of a Sequence Diagram Framework
Patch committed!
Planned for 0.8.1 Is this suitable for a bug-fix release (0.8.1) or should the Target Milestone be set to 0.9.0? Sorry, I meant to ask if this has been cherry-picked to stable-0.8. This is a brand new feature. 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 Delivered in 0.9.0 |