Book a Demo

Author Topic: Script results embedded in EAP  (Read 8263 times)

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Script results embedded in EAP
« on: February 25, 2016, 06:14:18 am »
I'm using EA 12.1 and am trying to modify some existing scripts.  I've been using EA for a number of years, but have not done anything with the script tools until recently.  The current VB script exports the results in a table format (based on a template) to a Word document which is in turn copied into an Excel file for additional processing using Excel VB Macros.  I think that most if not all of the processing could be eliminated with some help.

Right now I'm trying to generate an "integrated architecture" that is published as HTML for delivery to the customer.  The DoDAF OV-3 and SV-6 elements had previously been generated as external documents.  I know that I can insert finished documents back into EA, but would like to eliminate that requirement by generating them such that they are part of the HTML published model.

Instead of exporting the results to a Word document, can the EA script tools be used to generate (and update) an embedded linked document?  If so, does anyone have samples of VB script?

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Script results embedded in EAP
« Reply #1 on: February 25, 2016, 08:38:11 am »
To my knowledge there is no API to manipulate linked documents. It would be possible to fiddle directly with the t_document table, but that will likely not be so funny.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Script results embedded in EAP
« Reply #2 on: February 25, 2016, 08:42:00 am »
At a minimum, there is a function available to import a linked document from a file. Depending on the complexity of your document, and how much experimentation/research you want to do, you could  either write a simple generator or use the DocumentGenerator API class (which has functions like InsertText). Generate File, Read File, Delete File.

YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Re: Script results embedded in EAP
« Reply #3 on: February 25, 2016, 11:42:09 pm »
Let me playback what I think you want:
Produce output which combines model output with externally "generated" stuff.
A very good option would be to use eaDocX (I have no commercial interest - just a happy user).
You can place various sections in an external document that are interlaced with the existing content in that document.
One use case is to use an external document template with header, TOC, disclaimer, etc and ensure model output goes into the appropriate sections.
eaDocX document generation will not trample all over the existing content, just squirt in what you want, where you want.
What's more, in one of the editions, you can manage the documents within the model.
I don't think it let's you generate HTML in this way (i.e. interlacing model content and other content), but having produced a Word document you could save as HTML.

Then you won't have to script.

Hopefully I've understood your problem and this is a viable solution for you.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Script results embedded in EAP
« Reply #4 on: February 26, 2016, 02:45:51 am »
Actually, no I don't want to put any external stuff in the documentation.  I want to capture documentation existing in the model and provide it in a way that meets DoDAF requirements.  One way to do this is in a table form.  I can extract most of the data that I want and put it in a table that the existing script writes to an external document.  Without using some kind of script, we have not found any other way to collect the data in a form that is useful for this artifact.

I would like to not export anything if at all possible.  I do not need a formal Word document with TOC, headers, footers, etc.  I just need a table that is visible from within EA and so far the best I have seen is to somehow put it into a Linked document.  Maybe there is another way to get there.

We do need to eventually publish the model as HTML for delivery, so I need to make sure whatever I come up with is part of the HTML publish and is readable.

Gayle

YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Re: Script results embedded in EAP
« Reply #5 on: February 27, 2016, 12:30:30 am »
Hi Gayle
I recommend you download a trial of eaDocX - I'm sure you'll be pleased with the results.
It'll give you HTML tabulated (and hyperlinked) model content.
With the collaboration edition, you can even get non-model stakeholders to provide feedback in one place for all to see.
You can then take that feedback and push it through into the model from the document.
Hope that helps!
Matt

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Script results embedded in EAP
« Reply #6 on: February 27, 2016, 02:49:34 am »
Matt,

I've ended up going a different route.  Rather than creating a document, I have the script collecting the data I need and for each element writing it in the notes section of a class.  The script places all of these classes formatted appropriately to read on a diagram page.

I'm still missing one piece of information that I would like to include in the notes for each element, but have resolved two major problems - (1) how to capture the data within the model and place it in a readable format that will be part of the HTML model publish and (2) how to generate an up to date picture of the desired elements prior to publishing the HTML model.

Thank you for your ideas.

Gayle

YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Re: Script results embedded in EAP
« Reply #7 on: February 29, 2016, 07:42:22 pm »
Hi Gayle
That sounds like a neat trick, and of general use. Have you thought about posting it somewhere?
Does the diagram auto-refresh or can you place an "update" button on it to run the script?
Cheers
Matt
Namaste

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Script results embedded in EAP
« Reply #8 on: March 01, 2016, 02:37:34 am »
Matt,

I'm not sure where to post the ideas, but would be happy to.  I'm sure that my logic is relatively rough since I'm new to using VB scripts and it has been many years since I did any software coding.

As far as diagram updates, the way I set it up was to create a package and diagram.  The logic references the package by hardcoded package ID and the diagram by hardcoded diagram title (I don't yet know alternatives here).  A higher level diagram page needs to contain a link to the end diagram, so I needed a fixed diagram to use for the hyperlink.  The diagram contains a title and a link back to the parent diagram.  It is also set up to include notes in the elements.

When generating, right now, I access through the script - I'm hoping to find a way to use something like a hyperlink.  The logic finds the package and deletes all classes from the package (this ensures only one copy of each and the latest).  Then each of the diagrams that contain data are searched (using logic a previous coworker developed and elements he captured from the EA examples) and classes are created with the information I need placed in the notes.  After all of the classes are generated, alphabetically, the logic places each class on the diagram page.  The resulting diagram has about 21 pages and the paging is not perfect, but I think with some more work, I could make it align better.  I'm actually thinking about trying to place classes on one diagram for each use case that contains the sequence diagrams - that would give me a group of diagrams and might be more useful than one very long diagram.

Gayle