====== Scheduled run ======
Automatically launching a query or a set of queries at regular intervals is a common need in companies. This is why Vigilens offers you a mechanism for scheduling your queries.
===== Principle =====
It simply uses [[https://en.wikipedia.org/wiki/Windows_Task_Scheduler|Windows Task Scheduler]] to launch a command line. You can use either classic dos language (cmd) or Powershell.
Ex : ''C:\Vigilens\app\Vigilens.exe /vglAuto="C:\Vigilens\Work\Archives\DEMO\foder\myquery" /vglUser="SCHEDULE_FR"''
===== Setup =====
You do it in [[:en:v8_0_0:admintool:menus:accueil:start#batch_output|AdminTool Batch output menu]]. #TBC
You have to define users who will be allowed to connect with a command line.
{{:en:v8_0_0:howto:pasted:20200708-092836.png?nolink}}
===== Assistant =====
In Vigilens Designer, there is a [[:en:v8_0_0:designer:menus:accueil:start#scheduling_assistant|scheduling assistant]]. Use it to create the skeleton of your command, and adapt it to your needs. See our URL syntax guide below.
===== User =====
If you want to be sure that a free connexion will be available at the moment job is triggered, it may be useful to create [[:en:v8_0_0:admintool:menus:gestion:utilisateur:start#general|a specific user with "Vigilens Dedicated" profile type.]]
===== Syntax =====
==== /vglForceInstall ====
* Define a new shared directory. This option is the same for [[:en:v8_0_0:designer:start|Vigilens Designer]] and [[:en:v8_0_0:admintool:start|AdminTool]].
==== /vglExe=RequestName ====
* run query //RequestName//
* only __shared queries__ are allowed for running
* //RequestName// represents query relative path using shared directory as starting point, it means as it appears in **Vigilens Designer GUI**.
==== /vglAuto ====
* Processes all queries inside a directory __**interactively**__ provided by user
* For fully automated run, use /vglDir instead.
==== /vglDir=DirectoryName ====
* Automatic processing of all queries inside the directory given as a parameter
* //DirectoryName// the full path for the directory to be processed, as it appears in the **windows file explorer** on machine processing the command-line.
==== /vglDirConf ====
* profile used for automatic processing (/vglDir)
Starting with Windows Vista (or Server 2003), it is necessary to run this command as an administrator to allow processing by a task scheduler.
==== /vglUser=UserName ====
* Used combined with /vglDir to specify a user other than default user (assuming it has been supplied by /vglDirConf)
==== /vglMail=AdresseMail ====
* Used combined with /vglDir option to ask processing report (log) file to be sent
==== /vglNumFormat=DecimalsThousands ====
The numerical values returned will use :
* the first character as the decimal separator.
* the second as the thousands separator
==== /vglOutput=OutputType ====
* This optionnal setup is used combined with /vglExe.
* Force an output type other than the one defined at query level.
* possible values are
* Grid : default
* PDF
* XLS
* TXT
==== /vglPDFType=PDFFileType ====
* Specify PDF output type
* possibles values are :
* 0 Grid
* 1 Report
* this parameter is mandatory with /vglOutput=PDF .
==== /vglPDFModel=PrintTemplate ====
* Specify the grid print template or report template
* this setup is mandatory with /vglOutput=PDF
==== /vglMaxLineNumber=Number ====
* Specify the maximum number of lines in the output.
* Beyond, query stops and returns an error message.
* This setup secures machines resources use.
==== Parameters passing ====
* Processing parameters values are passed in the command-line using their short code
* syntax : ''/ShortCode=SelectedValue''
* You cannot use wildcards as a parameter to set a selection