Home › Forums › eaDocX queries › Document based on a diagram
Home › Forums › eaDocX queries › Document based on a diagram
- This topic has 10 replies, 2 voices, and was last updated 10 years, 1 month ago by Neil Clayton.
-
AuthorPosts
-
16 October 2014 at 8:01 am #7879Neil ClaytonParticipant
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?
16 October 2014 at 10:22 am #7880eadocX SupportParticipantThe 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.16 October 2014 at 3:08 pm #7881Neil ClaytonParticipantThanks 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. 🙂
16 October 2014 at 3:26 pm #7882eadocX SupportParticipantI 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.17 October 2014 at 11:52 am #7883Neil ClaytonParticipantI’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 10 years, 1 month ago by Neil Clayton. Reason: Added more detail
17 October 2014 at 4:37 pm #7885eadocX SupportParticipantIt 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.17 October 2014 at 4:49 pm #7886Neil ClaytonParticipantI 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.
17 October 2014 at 5:00 pm #7887Neil ClaytonParticipantTaking the Glossary out worked speedwise! 🙂 But I still lose my sort order from my SQL Query. 🙁
Will try again on Monday. Thanks.
23 October 2014 at 11:57 am #7888Neil ClaytonParticipantHave 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 10 years, 1 month ago by Neil Clayton. Reason: Couldn't add EAP attachment.
23 October 2014 at 12:58 pm #7890eadocX SupportParticipantThe 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.23 October 2014 at 2:05 pm #7891Neil ClaytonParticipantIt’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. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.
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