4.7. Batch Execution / Anatella command-line

<< Click to Display Table of Contents >>

Navigation:  4. How to use Anatella? >

4.7. Batch Execution / Anatella command-line


You can execute “in batch” (without any human interaction) any Anatella-graph.


Let’s assume that the Anatella executables (“Anatella.exe” or “AnatellaConsole.exe”) are inside a directory inside your “PATH” environmental variable (this is the default setting for a standard Anatella installation).

To run an Anatella-Graph “in batch”, type:

AnatellaConsole.exe "<file_to_execute.anatella>"


Anatella.exe –e "<file_to_execute.anatella>"


Anatella.exe –r "<file_to_execute.anatella>"


The 2 parameters (“-e” and the <Anatella filename>) must be the first 2 parameters on the command line. The “-e” and “-r” parameters are equivalent (“e” stands for “execute” and “r” stands for “run”): A simple log-window will appear (the Anatella graph is thus not visible) (you can hide the log window with the “–s” option) and the graph is executed. The “AnatellaConsole.exe” executable will never create any new log-window: it will use the current shell (or console) window to display all the trace messages.



To run an Anatella-Graph, you can also type (but this is very uncommon):


Anatella.exe –i "<file_to_execute.anatella>"


The “-i” parameter opens the standard Anatella interface (that you typically use for interactively editing the Anatella graphs), load the graph and run it (“i” stands for “interactive” run). The Anatella graph is visible and you can “interact” with it. There exists very few Actions that allow some interactions while the graph is running (one such action is the “Assignment Solver”) and, most of the time, you will rather use the “-e” or “-r” parameters to run your Anatella graphs in a batch, un-attended mode..


When a program terminates, it always returns back to the operating system (i.e. to MS-Windows) a number. This number is named the “error level” of the program. By convention, an “error level” that is non-zero indicates that there was an error during the execution of the program. Anatella extends slightly the convention: More precisely:

Error Level=0: Everything went ok.

Error Level=1: There were some warnings during the execution of the Anatella Graph.

Otherwise: There were some errors during the execution of the Anatella Graph.


The Javascript engine included inside Anatella has some Anatella-Specific extensions. One of these extensions is the ProcessRunner class. This Javascript class allows you to run sequentially or in parallel:

Any external software (such as curl, scp, cmd, etc.)

Any Anatella graph (because you only need to run “Anatella.exe” with the proper command-line parameters).


Using the ProcessRunner class, you can access the “error level” of all the programs that have been launched. For example: it’s very easy to implement a very complex logic based on the success (“error level”=0) or the failure (“error level”>1) of the execution of your Anatella graphs. For a simple example of usage of the ProcessRunner class, see the ANATEL~1_img129 RunProcesses Action (see section 5.20.3.)


The ANATEL~1_img130 ParallelRun Action (see section 5.3.3.) also makes extensive use of the “error level” to detect errors or warnings during graph execution.