Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: bugbear on May 18, 2010, 03:23:57 pm

Title: Can I schedule documentation generation?
Post by: bugbear on May 18, 2010, 03:23:57 pm
Hi There,

Is there a way I can schedule (ie using a scheduled task or AT, or a command line option) which will allow me to generate an HTML report each night?

The only way I can see (potentially) is via the Automation interface - but this looks like a lot of work, and I would expect that many projects would have a similar need...

any suggestions?

Thanks for your help in advance
Title: Re: Can I schedule documentation generation?
Post by: Geert Bellekens on May 18, 2010, 04:26:27 pm
Why would it be more work with the Automation interface?
Writing an exe to perform that one task should take no more then about two hours (from scratch)

(use Project Interface.RunHTMLReport )

Geert
Title: Re: Can I schedule documentation generation?
Post by: bugbear on May 18, 2010, 05:04:41 pm
Thanks for your reply - a simple app sounds like a promising option

I guess I was hoping that someone had already written something like this, or that there is some command line way of generating (HTML) reports, already built in to EA

2 hours of coding is still 2 hours of coding - and given I'm not familiar with the interface, this sounds like a full day job.  plus I don't have VB licences, so If there's an alternative I'd be thankful!
Title: Re: Can I schedule documentation generation?
Post by: Geert Bellekens on May 18, 2010, 05:48:11 pm
Currently I'm writing my addins using C#.
At work I use the full version of VS, but at home I use the express (free) version, but you can also use Java or ... so licenses should not be an issue.

I would suggest you just start with it.

You can use this snippet to get started. This little exe written in C# connects to the currently openend instance, and runs the html report on the currently selected package.
Just make sure you add a reference to the EA.Interop dll to you project.
Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace EATest
{
    class Program
    {
        static void Main(string[] args)
        {
            object obj = Marshal.GetActiveObject("EA.App");
            EA.App eaApp = obj as EA.App;
            EA.Repository eaRepo = eaApp.Repository;
            EA.Project eaProject = eaRepo.GetProjectInterface();
            string xmlPackageGUID = eaProject.GUIDtoXML(eaRepo.GetTreeSelectedPackage().PackageGUID);
            eaProject.RunHTMLReport(xmlPackageGUID, "c:\\temp\\eaTest", "png", "<default>", "html");
            string error = eaProject.GetLastError();
        }
    }
}

Have fun  ;)

Geert

Title: Re: Can I schedule documentation generation?
Post by: Daniel Siegl on May 19, 2010, 08:22:27 pm
Hello,
we build a commandline tool that we run on our Build Server = Teamcity.
Read it here: http://blog.lieberlieber.com/2009/09/08/documentation-of-software-projects/
BR
Daniel