Book a Demo

Author Topic: Multiple fragments generation in documentation  (Read 4365 times)

Daniel Luna

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Multiple fragments generation in documentation
« on: February 04, 2014, 12:18:01 am »
hi there,

i´m in use of EA 10 to test the ability of documents Fragments.

In order to include general information related to a project, i have developed a VB Script Function that generate XML information for passing to Custom fields in a fragment template.

Reference to Templates must be include under package section and here is my problem:

"The VB Script is executed for each package and for those i get the fragment generated. One fragment for each package, but in my fragment i don't have package information but also general information, something like occurs in video demostration":

http://www.sparxsystems.com/resources/demos/reporting/webinar-20121219-enhanced-reporting.html
http://www.youtube.com/watch?v=FdZQ2m-tjIQ

So i need an only instance of my fragment on the document.
how I can avoid multiple occurrences of my fragment into the document?

Thanks in advance

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Multiple fragments generation in documentation
« Reply #1 on: February 04, 2014, 03:04:24 pm »
The package information can be conveyed using #PACKAGEID# as a replacement of #OBJECTID# on point 5 of:
 
http://www.sparxsystems.com/enterprise_architect_user_guide/10/reporting/custom_script_fragments.html
 

Daniel Luna

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Multiple fragments generation in documentation
« Reply #2 on: February 06, 2014, 12:25:09 am »
Thanks for your response but i have the same problem.

I send more information on my process:

1.- I have developed a VB Script "GetProjectSummary" where i get a specifc document element (PROJECT_SUMMARY) from my model, wich contains information from the project. So i save General Information for each project (model roots) in those elements and not in Document Constants.

The VB Script generates the information correctly in the form of XML format  (xmlResumen.xml)

2.-  I have developed a rtf template too, marked as a fragment, wich contains a custom section where i get the generated xml by the GetProjectSummaryfunction. Custom Script = GetProjectSummary(#PACKAGEID#);   (
https://www.dropbox.com/s/nzl0ge6oa66jlgc/Fragment_Custom.PNG)


3.- Finally, in my template document i include the reference to the Template {Template - PRP_TEMPLATE_MTTO_RESUMEN_DOC} under the package section and the rest of my document information to generate.

https://www.dropbox.com/s/nuu6z0wdel4136f/Sample_Document.PNG

4.- When i launch the Generate Documentation i get a Project SUMMARY for each package from my model when i want an only one at the beginning of the document.


I think something is wrong in my process or the sample demo has a problem if you want to include more packages in a document.


I welcome your comments and I appreciate your attention


Thanks a lot.






Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Multiple fragments generation in documentation
« Reply #3 on: February 06, 2014, 02:54:32 am »
Hello,

I would make a master document with two or more packages to reference to:
1. The first package for the project summary
    Use a package without childs
    A template with a fragment template/script as you have described
2. The package(s) for your documentation
    Here you don't need to use the fragment template

The first package has the only task to output the project summary.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Daniel Luna

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Multiple fragments generation in documentation
« Reply #4 on: February 11, 2014, 10:25:13 pm »
Thanks for all your responses

finally, the solution to my problem is the use of Master Document  as Helmut and Dermot O'Bryan reference.

The sample
http://www.sparxsystems.com/resources/demos/reporting/webinar-20121219-enhanced-reporting.html

is only for generating rtf documents over packages without son packages on those.

Solution:

<<When i want to create a Master Document that does not parse the tree of Package - i need to use Virtual Documents.>>

Then set my master document to only report the top package and my Template Fragments (no Child package section).
Then include another template to parse the packages (Use Cases etc.).

Thanks a lot

Regards