Topic
  • 35 replies
  • Latest Post - ‏2013-05-29T23:44:47Z by ChrisHardy68
SystemAdmin
SystemAdmin
3180 Posts

Pinned topic Generating GraphViz DOT Script in DXL

‏2012-06-20T15:31:56Z |
Is it possible to use DXL to generate a textual description of the modules and links in a DOORS database? It would be very nice to be able to use this capability to generate a file which could be used by the free and open source graph generating tool Graphviz (http://www.graphviz.org/) to generate maps of the links.
Has there been any work in this area? Does DXL have the capability to traverse links and output what is linked where?
Updated on 2012-10-02T16:47:46Z at 2012-10-02T16:47:46Z by SystemAdmin
  • llandale
    llandale
    3035 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-20T18:51:13Z  
    Are you asking can DXL following links all over the database in order to determine which modules are linked to which other modules? Well of course it can.

    For each module, for each outgoing link keep track of the tripple SourceMod-LinkMod-TargetMod, use the LinkMod to determine a "verb", and present: SourceMod verb TargetMod;
    e.g. SubSys1 "Satisfies" SystemSpec

    -Louie
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-20T18:58:45Z  
    About 8 years ago I generated such a beast by passing a text file to visio (they took away this ability after visio 2002). Two or three years ago Jeremy Dick previously of Telelogic and now of Traceline introduced me to graphviz which he was using for some unrelated purpose, and I converted the visio dxl into graphviz dxl within a day or so. So yes it is fairly easy and very powerful. It would be even more powerful if the svg format was readily used in companies (Internet Explorer does not support it)

    When I am bored I play with doors visualisation - amazing what you can do. I have a website that I have half finished - where you could download the tool, assuming I told people where it is!! I will attempt to finish my website in the next couple of weeks and make it available then. Putting the prototype of the visualiser on the web site defeated my energy levels especially using the right security settings. Here's a picture of the free tool assuming anyone's interested.

    Regards,

    Richard
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-20T19:17:26Z  
    Interesting stuff - I figured it must be possible. I'm a DXL beginner though, so wouldn't know where to start. I'm just curious really.

    As for that tool - I would be very interested in seeing the results. Thanks for sharing!
  • Mathias Mamsch
    Mathias Mamsch
    2183 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-20T21:35:18Z  
    Interesting stuff - I figured it must be possible. I'm a DXL beginner though, so wouldn't know where to start. I'm just curious really.

    As for that tool - I would be very interested in seeing the results. Thanks for sharing!

    The problem is, that iterating the links of a database can take hours to complete, depending on the size of the project you want to evaluate. Therefore I would not suggest you write a DXL script that will directly dump information to a graphvis file, because then you have to nail the layout right away. If you want to have another layout or experiment with graphvis you would need to reiterate the links.

    Therefore my suggestion would be to make two tools (which can be combined later), one for just dumping all the links, which is pretty easy:
     

    ... see attached file dumpLinksExample.dxl ...
    

     


    Then once you have all the links dumped to a file (you can dump information about the objects too), you can calculate statistics on it. I attached an example file, that shows how to read the links from the file back to an array, and make statistics on the array, e.g. count source/target module pairs and the number of links that are between them. You can do this in any language, I show a way of how to do that in DXL.

     

     

     

    ... see attached file linkStatistics.dxl ...
    



    Well and from there finally you can generate your dot file. To draw a picture of the modules that link to each other you would want something like that



     

     

     

     

    ModuleA -> ModuleB
    ModuleB -> ModuleC
    ModuleD -> ModuleC
    



    which you can now enrich with whatever additional information you like, e.g. the link module that is used or the number of links, or the number of requirements in each module, etc. But that really depends on your use cases.

    Hope that helps you to start. Best regards, Mathias



     

     

     


    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

     

    Updated on 2014-01-06T19:11:16Z at 2014-01-06T19:11:16Z by JAntley
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-20T23:55:05Z  
    About 8 years ago I generated such a beast by passing a text file to visio (they took away this ability after visio 2002). Two or three years ago Jeremy Dick previously of Telelogic and now of Traceline introduced me to graphviz which he was using for some unrelated purpose, and I converted the visio dxl into graphviz dxl within a day or so. So yes it is fairly easy and very powerful. It would be even more powerful if the svg format was readily used in companies (Internet Explorer does not support it)

    When I am bored I play with doors visualisation - amazing what you can do. I have a website that I have half finished - where you could download the tool, assuming I told people where it is!! I will attempt to finish my website in the next couple of weeks and make it available then. Putting the prototype of the visualiser on the web site defeated my energy levels especially using the right security settings. Here's a picture of the free tool assuming anyone's interested.

    Regards,

    Richard
    I also thought of Jeremy's work in this area with his DOORS TraceLine add-on product - it's worth having a look at http://www.integrate.biz/traceline/

    But lets face it - DOORS should have been supporting interactive graphical views of Project, Module, Link, Object and Attribute schemas 10 years ago. I wait to see what the "DOORS Next Generation" product might offer in this space - should I hold my breath?


    Paul Miller
    Melbourne, Australia
  • OurGuest
    OurGuest
    163 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-21T10:42:37Z  
    I also thought of Jeremy's work in this area with his DOORS TraceLine add-on product - it's worth having a look at http://www.integrate.biz/traceline/

    But lets face it - DOORS should have been supporting interactive graphical views of Project, Module, Link, Object and Attribute schemas 10 years ago. I wait to see what the "DOORS Next Generation" product might offer in this space - should I hold my breath?


    Paul Miller
    Melbourne, Australia
    With IBM depreciating the value of help files how can you possible believe that they will improve the users life in other areas?
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-21T15:32:52Z  
    • OurGuest
    • ‏2012-06-21T10:42:37Z
    With IBM depreciating the value of help files how can you possible believe that they will improve the users life in other areas?
    Hi,

    This has already been developped in the context of Requirements Management Framework addins ... Interactive usage of Graphviz allowing to display interactive tracability graphs in DOORS with operations based on graphic views (modules,objects,model) ...

    I developped also some less sophisticated scripts outside of RMF to vizualize graphs

    Luc
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-21T15:37:37Z  
    • OurGuest
    • ‏2012-06-21T10:42:37Z
    With IBM depreciating the value of help files how can you possible believe that they will improve the users life in other areas?
    As soon as it moves to a proper relational database server structure, I think a lot of problems will be resolved, and more third party features will be available.
    I can't wait that long though.
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-21T15:38:27Z  

    The problem is, that iterating the links of a database can take hours to complete, depending on the size of the project you want to evaluate. Therefore I would not suggest you write a DXL script that will directly dump information to a graphvis file, because then you have to nail the layout right away. If you want to have another layout or experiment with graphvis you would need to reiterate the links.

    Therefore my suggestion would be to make two tools (which can be combined later), one for just dumping all the links, which is pretty easy:
     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">... see attached file dumpLinksExample.dxl ... </pre>

     


    Then once you have all the links dumped to a file (you can dump information about the objects too), you can calculate statistics on it. I attached an example file, that shows how to read the links from the file back to an array, and make statistics on the array, e.g. count source/target module pairs and the number of links that are between them. You can do this in any language, I show a way of how to do that in DXL.

     

     

     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">... see attached file linkStatistics.dxl ... </pre>



    Well and from there finally you can generate your dot file. To draw a picture of the modules that link to each other you would want something like that



     

     

     

     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">ModuleA -> ModuleB ModuleB -> ModuleC ModuleD -> ModuleC </pre>



    which you can now enrich with whatever additional information you like, e.g. the link module that is used or the number of links, or the number of requirements in each module, etc. But that really depends on your use cases.

    Hope that helps you to start. Best regards, Mathias



     

     

     


    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

     

    That's great, I was able to generate something good with that. I will have to work on it some more in my spare time, but thank you!
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-21T15:46:41Z  
    Hi,

    This has already been developped in the context of Requirements Management Framework addins ... Interactive usage of Graphviz allowing to display interactive tracability graphs in DOORS with operations based on graphic views (modules,objects,model) ...

    I developped also some less sophisticated scripts outside of RMF to vizualize graphs

    Luc
    That looks very interesting. Could you provide a link to that addon? I searched the IBM product page and strangely enough couldn't find it.
  • llandale
    llandale
    3035 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-21T16:57:44Z  
    You may also eschew looking at all the links and decide instead to find all the link modules and map based on the existence of link-sets therein. You may also want to find all the LinkSetPairings (LinkModuleDescriptors in DXL) in all the folders. This should produce a "should" mapping, even if there are not any links yes (e.g. from the new Test module to the SubSys spec).

    -Louie
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-22T12:21:11Z  
    That looks very interesting. Could you provide a link to that addon? I searched the IBM product page and strangely enough couldn't find it.
    Hi,

    But it is a licensed addon ...

    You can find some information here:
    http://www-01.ibm.com/support/docview.wss?uid=swg24032745

    With some DXL work you may extract information from DOORS and generate a dot file for Graphviz. In any case you have to filter data if you want readable graphic views.

    I used that to generate PDF and also interactive HTML files, with the html and map Graphviz generation you may have a clickable display that can be used to open DOORS data.

    Attachments

  • adevicq
    adevicq
    154 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-26T10:08:41Z  
    • llandale
    • ‏2012-06-21T16:57:44Z
    You may also eschew looking at all the links and decide instead to find all the link modules and map based on the existence of link-sets therein. You may also want to find all the LinkSetPairings (LinkModuleDescriptors in DXL) in all the folders. This should produce a "should" mapping, even if there are not any links yes (e.g. from the new Test module to the SubSys spec).

    -Louie
    All,
    You can find attached a first attempt of a (simple) graph generator for GraphViz.
    The graph displays the linksets defined in the current folder/project and its children.

    Alain
  • adevicq
    adevicq
    154 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-26T10:31:15Z  
    • adevicq
    • ‏2012-06-26T10:08:41Z
    All,
    You can find attached a first attempt of a (simple) graph generator for GraphViz.
    The graph displays the linksets defined in the current folder/project and its children.

    Alain
    removed a bug...
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-26T15:13:47Z  
    • adevicq
    • ‏2012-06-26T10:31:15Z
    removed a bug...
    Hello,

    when running the getLinksetGraph.dxl what is the trick to view the results in a readable format; meaning enlarging the view. I tried to modifying the "size" with limited success. Thank you.

    -Jim
  • adevicq
    adevicq
    154 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-26T15:49:31Z  
    Hello,

    when running the getLinksetGraph.dxl what is the trick to view the results in a readable format; meaning enlarging the view. I tried to modifying the "size" with limited success. Thank you.

    -Jim
    it seems that if you delete the line 'size="XX,XX"' it works better for very big diagrams...
    alain
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-06-29T14:33:33Z  
    A link to my website, where you can download my spin on doors with graphviz. The website is driving me around the bend, but the downloads should work ok!
    http://www.chalford.net/Downloads.aspx
  • adevicq
    adevicq
    154 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-07-02T13:07:33Z  
    A link to my website, where you can download my spin on doors with graphviz. The website is driving me around the bend, but the downloads should work ok!
    http://www.chalford.net/Downloads.aspx
    Hi,

    I have executed you installer and I don't see anything new in PSPad (no new menu as shown on your site).
    FYI I am on W7...
    Is there anything I can do?
    Regards,
    Alain
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-07-04T16:16:39Z  
    • adevicq
    • ‏2012-07-02T13:07:33Z
    Hi,

    I have executed you installer and I don't see anything new in PSPad (no new menu as shown on your site).
    FYI I am on W7...
    Is there anything I can do?
    Regards,
    Alain
    It worked well in rehersals. i.e. on my machine, buit that can hardly be considered a massive test. I'll exercise thte tool a bit more.

    The pspad addin, contains a stable pspad variant with the dxl addin which allows you to interpret the errors and return them to the log window and to pass the current file as an <#include> wrappered file to the clipboard.

    Whilst wrappering this all up I thought I'd play around with self extracting zip files and create an autohotkey generated script file for automatically installing the addin to an existing version of pspad.

    The tool also checks that you have DOORS on your machine and links to the relevant dxl help file in the install directory. such that you can use it within pspad.

    The tool does not install if you do not have doors on your machine, this may be a over the top.

    I'll have a look at the install again with a view to simplifying it rather than seeing what can and can't be done. I suspect it may be failing silently for some reason, possibly because your machine does not allow unsigned exes to run.

    If you have a specific error message then please let me know.
    You can send me a personal email through my website.

    The pspad addin can be built with a few files and some manual tweaking I may add a method to do this as an alternative on my website
  • adevicq
    adevicq
    154 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-07-04T16:24:03Z  
    It worked well in rehersals. i.e. on my machine, buit that can hardly be considered a massive test. I'll exercise thte tool a bit more.

    The pspad addin, contains a stable pspad variant with the dxl addin which allows you to interpret the errors and return them to the log window and to pass the current file as an <#include> wrappered file to the clipboard.

    Whilst wrappering this all up I thought I'd play around with self extracting zip files and create an autohotkey generated script file for automatically installing the addin to an existing version of pspad.

    The tool also checks that you have DOORS on your machine and links to the relevant dxl help file in the install directory. such that you can use it within pspad.

    The tool does not install if you do not have doors on your machine, this may be a over the top.

    I'll have a look at the install again with a view to simplifying it rather than seeing what can and can't be done. I suspect it may be failing silently for some reason, possibly because your machine does not allow unsigned exes to run.

    If you have a specific error message then please let me know.
    You can send me a personal email through my website.

    The pspad addin can be built with a few files and some manual tweaking I may add a method to do this as an alternative on my website
    OK.
    One question: How do you check that DOORS is installed on the machine? Remember that the registry keys are different on Windows 7. Maybe there is a possible issue here...
    FYI I have no message when I run the installer.

    Regards,
    Alain
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-07-05T11:50:34Z  
    • adevicq
    • ‏2012-07-04T16:24:03Z
    OK.
    One question: How do you check that DOORS is installed on the machine? Remember that the registry keys are different on Windows 7. Maybe there is a possible issue here...
    FYI I have no message when I run the installer.

    Regards,
    Alain
    I tested the tools on another machine and seemed to have problems with the current directory for some bizarre reason. I have changed both tools on my website to cope with this. They should hopefully behave as intended. Note I also had an issue with the autohotkey com library I use to return the errors from DOORS meaning that the errors were not returned properly to the pspad log window, I think its being blocked, which is a bit of a bind as this is the major benefit of using the plugin.
    I'll think of an alternative this weekend as although these are free tools I want them to work for at least 99% of people. I have tested on DOORS 9-2 and DOORS 9-3 on Xp and Windows 7. The pspad plugin is not returning the errors correctly on the windows 7 machine. The linksetviewer plugin installed everything, but sometimes created a shortcut to the temporary install area not where you chose to install the plugin. You will need to download the tools again
  • adevicq
    adevicq
    154 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-07-09T20:37:19Z  
    I tested the tools on another machine and seemed to have problems with the current directory for some bizarre reason. I have changed both tools on my website to cope with this. They should hopefully behave as intended. Note I also had an issue with the autohotkey com library I use to return the errors from DOORS meaning that the errors were not returned properly to the pspad log window, I think its being blocked, which is a bit of a bind as this is the major benefit of using the plugin.
    I'll think of an alternative this weekend as although these are free tools I want them to work for at least 99% of people. I have tested on DOORS 9-2 and DOORS 9-3 on Xp and Windows 7. The pspad plugin is not returning the errors correctly on the windows 7 machine. The linksetviewer plugin installed everything, but sometimes created a shortcut to the temporary install area not where you chose to install the plugin. You will need to download the tools again
    Hi,
    I made the setup manually for the DXL "compiler" and DXL returns the errors as expected.
    The only thing I do not have is your "script" menu...

    Alain
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-07-10T10:42:35Z  
    • adevicq
    • ‏2012-07-09T20:37:19Z
    Hi,
    I made the setup manually for the DXL "compiler" and DXL returns the errors as expected.
    The only thing I do not have is your "script" menu...

    Alain
    I suggest you download the zip file (see my other thread) and simply unzip it somwhere. This should give you the open include file and the send current file in #include to clipboard scripts.

    If you use pspad for something else then you need to copy the dxl.vbs file to the \PSPad editor\Script\VBScript folder to get the script functionality. You should get the dxl menu as shown in the screenshot.

    Regards,

    Richard
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Generating GraphViz DOT Script in DXL

    ‏2012-10-01T17:17:33Z  
    • adevicq
    • ‏2012-06-26T10:31:15Z
    removed a bug...
    Hi, I'm finally getting back to checking this out.

    I tried the script, but first I had to comment out the bit asking if I have GraphViz installed, and the last line where it runs GraphViz, because I want to take the generated file and run it on a different machine.

    Where is the file saved? I ran the script (Tools > Edit DXL > Load > Run) from the root of the project, and it output what looks like all the folders in the project. The output didn't show anything that looked like GraphViz - is that correct?

    Then I searched for any .gv files on the machine, but there were none.

    I thought maybe the temp file would be deleted after the run, so I set the filename to always be DOORS_Graphviz.gv. But after running, I still couldn't find the output file.