Author Topic: Automation of "Create Document to Artifact"  (Read 3457 times)

Nick Wh

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Automation of "Create Document to Artifact"
« on: June 12, 2012, 10:44:42 pm »
Being able to store RTF documents within a repository is great, because hyperlinks to them stay consistent, so HTML websites do not end up with broken links if a network drive changes or is not accessible.  This is made even better using the model documents / document artifacts and "Create Document to Artifact" option.

So, we have a number (quite a lot!) of these reports stored in document artifacs and linked to from the notes sections in certain elements.

We would like to be able to automate the generation of multiple of these documents, which otherwise have to be generated manually one-by-one in a time-consuming and labourious manner.
 
I have some code that will iterate through packages to find the elements with a stereotype of "document" (ideally this would also look for a Trace dependency relationship to an element with stereotype of "model document", but I haven't got that sophisticated yet).

The problem I have is finding any information that will let me invoke / automate the interface equivalent to right clicking on the document artifact and selecting "Create Document to Artifact".  I have found the Repository.CreateDocumentGenerator() object, but I suspect what is needed is more of an 'Element.CreateDocumentGenerator()' interface.  The DocumentGenerator Class seems to be based on the repository document interface, which is saving documents to the file system rather than within the repository.

The help I am using is in the EA User Guide, and I've found the Jscript documentation example. Neither of these get close.

Has anyone tried to automate the 'create document to artifact' process using the API?  Or have ideas of how to do so?

The only way would seem to be emulating the behviour of the "Create Document to Artifact" function in code, and using a temporary file.

Seeing as the 'model document' / 'document artifact' idea seems to be all about modelling how to generate documents, it's a shame there is not way to automate it.
 
Nick

Ian Mitchell

  • EA User
  • **
  • Posts: 506
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: Automation of "Create Document to Artifact"
« Reply #1 on: June 13, 2012, 02:13:26 am »
It looks like you have big investment in the RTF approach, so this suggestion may not be that helpful but...
<product plug>
Have you tried eaDocX? We support generating multiple documents at the same time, and are just finishing testing a document versioning feature which may provide what you need?
</product plug>
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Automation of "Create Document to Artifact"
« Reply #2 on: June 13, 2012, 10:57:10 am »
Probably multiple steps to automate it.

Run the report to export to a file.
Import the file into the appropriate linked document.