Author Topic: Task Scheduler  (Read 4597 times)

msdb

  • EA Novice
  • *
  • Posts: 10
  • Karma: +1/-0
    • View Profile
Task Scheduler
« on: September 12, 2016, 06:12:03 pm »
Hi

I've written a C# console program that uses the EA Api to access a repository and export an xmi file. I'm trying to make this program run automatically on a windows server 2008 with the task scheduler which works fine when I'm logged on to the server, however, I'd like it to be able to run when I'm not. This doesn't seem possible though, no matter what settings I use. Thus far, I've assumed that windows was the problem, not EA.

Has anyone tried something similar or know whether EA is unable to be launched without a logged in windows user?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8561
  • Karma: +209/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Task Scheduler
« Reply #1 on: September 12, 2016, 06:16:34 pm »
This is a know issue.
The easiest solution is to make it run with an actual user logged in.

Apparently the guys from LieberLieber managed to get it running as an actual service, but haven't heard anyone else being able to reproduce their result.
See http://blog.lieberlieber.com/2012/09/03/ea-as-an-unattended-windows-service-on-windows-server-2008r2-and-higher/ for more info

Geert

OpenIT Solutions

  • EA User
  • **
  • Posts: 474
  • Karma: +5/-0
    • View Profile
Re: Task Scheduler
« Reply #2 on: September 12, 2016, 07:15:18 pm »
Hi,

I don't think you need to follow the steps in the article that Geert refers to IF you are attempting to run your c# app via the Task Scheduler. Just make sure that the user account you use (you can set an explicit user for a Task) has a) run Sparx on the server - so the license has been set and b) has full permission to write to the file system, connect to sparx and use a network connection.

I have a c# app that runs via the task scheduler each night and generates html via Sparx API. So it should work.

Regards,

Jon.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8561
  • Karma: +209/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Task Scheduler
« Reply #3 on: September 12, 2016, 09:07:58 pm »
Hi,

I don't think you need to follow the steps in the article that Geert refers to IF you are attempting to run your c# app via the Task Scheduler. Just make sure that the user account you use (you can set an explicit user for a Task) has a) run Sparx on the server - so the license has been set and b) has full permission to write to the file system, connect to sparx and use a network connection.

I have a c# app that runs via the task scheduler each night and generates html via Sparx API. So it should work.

Regards,

Jon.
If indeed you can specify a "real" user in the task that might be enough to work. Of course you'll need to have EA installed on the server as well.

msdb

  • EA Novice
  • *
  • Posts: 10
  • Karma: +1/-0
    • View Profile
Re: Task Scheduler
« Reply #4 on: September 12, 2016, 11:21:34 pm »
Thank you both for replying.

I've tried what you suggest. EA is installed on the server and a user has been specified for the task. When I log back in to the server I can see that EA.exe is running, so it has been launched but no export occurs.
I have also given the user full write/read access to the export folder and where EA.exe is located. Not sure what else I can do.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8561
  • Karma: +209/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Task Scheduler
« Reply #5 on: September 12, 2016, 11:35:14 pm »
I have a client that has the scheduled task running on a spare pc somewhere under a desk (with a sticker "Don't ever turn off!")

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 9783
  • Karma: +181/-153
  • I'm no guru at all
    • View Profile
Re: Task Scheduler
« Reply #6 on: September 12, 2016, 11:35:37 pm »
It still sounds as if you launch it as service. That does not work. You need a real login and a console. Consider a Citrix environment where you can disconnect a user.

q.

OpenIT Solutions

  • EA User
  • **
  • Posts: 474
  • Karma: +5/-0
    • View Profile
Re: Task Scheduler
« Reply #7 on: September 13, 2016, 02:18:32 am »
Hi,

Have you actually logged in as the user on the server and started Sparx ? You need to do this so the license is correctly assigned to the user on their first run of EA. If you don't do this when connecting to Sparx API via a scheduled task - you will get the behavior you observe, ie Sparx will be running, but not doing anything - as what is actually happening, is that Sparx has started up under the users accounts/session and is waiting for them to enter their license key.

Regards,

Jon.

Dani_baer

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Task Scheduler
« Reply #8 on: December 14, 2016, 02:21:35 am »
Hi

Is there a solution to this problem?

thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8561
  • Karma: +209/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Task Scheduler
« Reply #9 on: December 14, 2016, 03:05:30 am »
Yes, log in, make sure EA runs when started manually, then create a scheduled task under the same user and make sure that user is always logged on the machine that has the scheduled task.
Not ideal, but it works.
IIRC there are also tools and/or settings to make sure a certain user is automatically logged in when the computer reboots.

Geert

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1130
  • Karma: +78/-72
    • View Profile
Re: Task Scheduler
« Reply #10 on: December 14, 2016, 11:36:01 am »
Is there a solution to this problem?

The user account you are using has to have permissions to log on and run applications.  From memory the local policy has to include "Log On Interactively" for that user.