Author Topic: Scheduling a nightly HTML report  (Read 2901 times)

adepreter

  • EA User
  • **
  • Posts: 94
  • Karma: +2/-2
    • View Profile
Scheduling a nightly HTML report
« on: July 19, 2016, 10:08:54 pm »
We have some trouble publishing as HTML using a scheduler on Windows Server.
Our schedulers can export to Excel, create a Project Transfer et... but not an HTML report.
Does anybody have similar problems and knows how to fix this?
Thank you,
Alain

Here are the symptoms:

We wrote a c# program that does a runHTMLReport.

When the programme is launched via a bat file in command line it works fine.

When the same bat file is used by the windows tasks scheduler: the process is launched, we see the EA process starting in the tasks manager, but it ends quickly without generating anything. This is happening either when launched as a local admin user or the service user.

We modified the program to run as Timer class, replacing the windows scheduler tasks inside the program. It works fine launched as me. The problem is it stops if we logoff. Using the runas command to run it as the service user doesn’t work. We get back a message “Attempting to start EAGenerateDocumentation.bat as user …” but nothing happens.

We modified again the program to use TopShelf to turn it as a service. In command line it runs fine, but installed as service, it doesn’t do anything.

OpenIT Solutions

  • EA User
  • **
  • Posts: 464
  • Karma: +4/-0
    • View Profile
Re: Scheduling a nightly HTML report
« Reply #1 on: July 19, 2016, 10:34:20 pm »
Hi,

Sparx always needs to run under a user. The user it runs under must have run sparx before in an interactive session and entered/accepted the license details.

If your scheduled job is running under a system account that has not run sparx before, it will just be sitting their waiting for someone to enter/accept the license. See this article for further details:

http://community.sparxsystems.com/tutorials/603-75ea-as-an-unattended-windows-service-on-windows-server-2008r2-and-higher

adepreter

  • EA User
  • **
  • Posts: 94
  • Karma: +2/-2
    • View Profile
Re: Scheduling a nightly HTML report
« Reply #2 on: July 20, 2016, 12:03:33 am »
Thank you very much for your quick answer. This is quite interesting. However it can't be a problem with the license as we did enter the license (shared key, which is not ideal for scheduled job I agree) beforehand and there are other scheduled jobs that are running fine (Project Transfer and Export to Excel).

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6354
  • Karma: +54/-5
    • View Profile
Re: Scheduling a nightly HTML report
« Reply #3 on: July 20, 2016, 08:14:24 am »
Assuming you have EA set-up correctly and can perform other actions like you suggest, it seems like it's going to be an issue with the target location for the html report.

Where is the report being generated to? Does the user the script is executing against have appropriate writes for that location? (I'd try putting a direct file copy in the batch file to test)
Simon

support@sparxsystems.com

Dani_baer

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Scheduling a nightly HTML report
« Reply #4 on: December 13, 2016, 08:56:32 pm »
dear all,

I tried to run EA as non-interactive user without success. Also this article does not help:
http://community.sparxsystems.com/tutorials/603-75ea-as-an-unattended-windows-service-on-windows-server-2008r2-and-higher

Is there a way to run EA as scheduled task on a windows sserver 2012?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Scheduling a nightly HTML report
« Reply #5 on: December 14, 2016, 01:26:12 am »
Yes, as long as you have a user logged in you run scripts as scheduled tasks.
The only problem is that you have to make sure that there is a user logged in on the machine that runs the scheduled task. I don't think it really matters whether that is a windows server or workstation.

Geert