Products

Home Forums eaDocX queries Document based on a diagram

Home Forums eaDocX queries Document based on a diagram

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #7879
    Neil Clayton
    Participant

    I am trying to create my first document which is based on a diagram. I have the following in EA:

    [table]
    [tr]
    [td]Package A[/td]
    [td][/td]
    [td][/td]
    [/tr]
    [tr]
    [td][/td]
    [td]diagram 1[/td]
    [td][/td]
    [/tr]
    [tr]
    [td][/td]
    [td]element 1[/td]
    [td][/td]
    [/tr]
    [tr]
    [td][/td]
    [td]element 2[/td]
    [td][/td]
    [/tr]
    [tr]
    [td]Package B[/td]
    [td][/td]
    [td][/td]
    [/tr]
    [tr]
    [td][/td]
    [td]element 3[/td]
    [td][/td]
    [/tr]
    [tr]
    [td][/td]
    [td][/td]
    [td]element 4[/td]
    [/tr]
    [tr]
    [td][/td]
    [td][/td]
    [td]element 5[/td]
    [/tr]
    [tr]
    [td][/td]
    [td]element 6[/td]
    [td][/td]
    [/tr]
    [/table]

    • Package A contains a diagram and some elements which are related to elements in Package B.
    • Diagram 1 contains all but element 4 from Package B and all the elements from Package A.
    • Package B contains a hierarchy of elements (parent-child relationship in the EA Project Browser) which is reinforced with Specialization relationships.

    What I would like my document to look like:

    [table]
    [tr]
    [td]1.[/td]
    [td]element 3[/td]
    [/tr]
    [tr]
    [td][/td]
    [td]table of elements from Package A related to element 3[/td]
    [/tr]
    [tr]
    [td]1.1[/td]
    [td]element 5[/td]
    [/tr]
    [tr]
    [td][/td]
    [td]table of elements from Package A related to element 5[/td]
    [/tr]
    [tr]
    [td]2.[/td]
    [td]element 6[/td]
    [/tr]
    [tr]
    [td][/td]
    [td]table of elements from Package A related to element 6[/td]
    [/tr]
    [/table]

    I created a document based on the diagram with the ‘contents, no diagram attribute set) which gives me a list of the elements on the diagram, but what I really want is a document including just the elements on the diagram but in a hierarchy as modelled on the diagram.

    Is that possible?

    #7880
    eadocX Support
    Participant

    The challenge with documenting the contents of a diagram is ‘how to decide the order of printing’? When eaDocX asks EA for the contents of a diagram, we get back a flat list of elements. eaDocX will group similar-formatting elements together, and print them in order of Element type, but we can’t go much beyond that: we just don’t know any more. Printing from diagrams works well when the diagrams are either in a section by themselves or when they live in a package with no other element: stops too many duplicates from printing.

    You have some alternatives:
    1 – Document Package B, which will print elements 3,4,5,6 , then specifically exclude element4
    – not sure how you can tell eaDocX to print only those elements which relate to these, which are just the ones which are in a specific package: you can restrict by the type of element, and the type of connection, which is the more normal way to do things. Even if eaDocX could do this, it would be a very fragile way to model.
    2- create an EA Model View, and put your elements into that, and print the Model View in its own section.

    #7881
    Neil Clayton
    Participant

    Thanks for the response. It feels like I could do with writing a script to generate a view based on the elements and hierarchy in my diagram. Will give it a go and see how I get on. 🙂

    #7882
    eadocX Support
    Participant

    I didn’t include scripting as another alternative, but if you’re feeling brave, then this is also an option.
    If the elements are of a predictable type/stereotype, then you can write a little script in EA which is in effect a tiny generator. So long as it creates a string of well-formed HTML, then eaDocX will use it.
    Such a script can then to really clever things like checking the parent element of something which you’re printing, and only printing the ones you want.
    There are some examples on the website.

    #7883
    Neil Clayton
    Participant

    I’ve actually used a Report section based on an EA Search based on a SQL query which delivers my elements in the order that I want them sorted in. However when I view the document gernated in draft mode by EADocX it seems to have lost my sort order. Is this because I ran it in draft mode or does EADocsX never let you specify the order?

    I have tried generating it in draft but this seems to hang my machine. Or to be specific EA becomes unresponsive and Word occupies 25% of my cycles on a 4 core machine. It seems to insert all the content OK but never seems to complete the step after that — of course I could be being too impatient but I have waited about an hour for it to complete with Word reporting the generated document to be only 10 pages long.

    • This reply was modified 9 years, 11 months ago by Neil Clayton. Reason: Added more detail
    #7885
    eadocX Support
    Participant

    It should be able to generate a document that small in a few seconds – something’s clearly gone wonky.
    A couple of ideas:
    1 – is your SQL query a well-behaved one? Does it have the structure which eaDocX expects (see help)
    2 – do you have a glossary? We’ve just had a really strange ‘hanging’ error where Word became un-responsive as eaDocX was trying to create the glossary: it didn’t like looking for the glossary entry ‘EA’ ! Very odd one, this. If you have one, try removing it, and trying again.

    #7886
    Neil Clayton
    Participant

    I did have a Glossary in it. I don’t think that my SQL was weird although it does return the Notes attribute.

    A small part of me wonders whether it is to do with Word templates and where they are stored. I seem to remember from building a reporting engine that automated Word 2003 that you needed to be careful with where the Normal.dot template was as things could slow down greatly if Word couldn’t find one. I’ll investigate further on Monday.

    #7887
    Neil Clayton
    Participant

    Taking the Glossary out worked speedwise! 🙂 But I still lose my sort order from my SQL Query. 🙁

    Will try again on Monday. Thanks.

    #7888
    Neil Clayton
    Participant

    Have tried again and restructured my Word doc to, I hope, better fit EADocX’s way of working but obviously have more of a problem than I thought! The sort order doesn’t follow the order in the Project Browser in my EAP file — no idea what I am doing wrong but presume I must have set an option somewhere that tells EADocX to ignore the EA sort order.

    Happy to e-mail you an extract from my EA database and the Word doc generated if you let me know what e-mail address to send it to. 🙂

    • This reply was modified 9 years, 11 months ago by Neil Clayton. Reason: Couldn't add EAP attachment.
    #7890
    eadocX Support
    Participant

    The problem with losing the EA sort order is known. I thought we had a forum posting about it, but I can’t find it….
    The problem is that as you create elements under a package, EA shows the elements in the order you created them. But they have no explicit sort order in the DB. Only when you move one up/down (with the green arrows in the Project browser) does EA write sorting data to the DB, which eaDocX can use.
    So, if the order in eaDocX is different from that in EA, just pick an element, move it up, then back down, then eaDocX will get the explicit ordering information. Same is true for Packages under packages.

    #7891
    Neil Clayton
    Participant

    It’s in the FAQ. I found it about an hour ago. My elements have quite a deep hierarchical structure and I discovered that I needed to move elements in each branch to get it to work right. Makes sense wen you think what is actually happening.

    Now working well. 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

Compare licence prices

Choose the licence that’s right for you and your team

Prices

Download a free trial

Download eaTeamWorks today for several free for life features, plus no obligation, 30-day trials of all the products: eaDocX, ea Revision Manager, eaSheets, Model Expert and PortfolioManager. Discover for yourself why we sell the world’s best-selling Enterprise Architect extension.

Download