Book a Demo

Author Topic: Document Generator: using SQL request to find a diagram Image/Note, ...  (Read 3164 times)

iri

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Hello,

I was asked to do a fairly large automated document generator for somme package in Sparx, so I currently use the generator present in Sparx.
What I have to do is that there are various packages with each one having the same structure:
- Package1 :
           o Package2 :
                    Diagrams
           o Package3
                    Package4
And so, I have to start generating the document on the Package1, and then I have to put certain types of diagrams in specific places, for example in the generated document regardless of the diagrams present in Package2 there will always be the same chapters presentin the generated document, and in these chapters I have to place certain specific types of diagrams there. For example, in Chapter 1,  I must place the diagram named "A", and below this diagram I must place what is written in the Note on this diagram.
What I'm currently doing is that in the Template I'm already writing all the chapters, and in each of the chapters I'm going to place a Fragment with an SQL query to find the right diagram like this:

SELECT ea_guid AS CLASSGUID, Diagram_Type AS CLASSTYPE,'t_diagram' as CLASSTABLE, Name
FROM t_diagram
WHERE Name like'A' and Package_ID = #PACKAGEID#

 
But this request only works if I start document generation on package2 and not package1, as the diagram is in package2. So my first question is how to use #Branch# in the query?
Then in the Fragment, I create a "Custom" section and in this section I would like to display the image of the found diagram and also what is written in the present Note of the diagram, but I can only display the Name, the type of the diagram and the guid, so is it possible to recover the image of the diagram, and its note? I have already searched on the internet but there are only a few tutorials on how to properly use document generation. And so finally recommend you to use this Sparx generator or use an extension like eaDocX is more efficient to make this kind of document?

Thank you very much!

iri

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Document Generator: using SQL request to find a diagram Image/Note, ...
« Reply #1 on: November 26, 2019, 01:27:01 am »
I ended up finding a solution with this tutoriel https://zubkiewicz.com/nonlinear-generation-of-documentation-in-sparx-enterprise-architect/
Using script is much easier for creating specific document!