Batch Manual

The use of SOFiE can also be integrated into an automated working environment, as it is often necessary for files that are processed in an automatic way by external systems.

In batch mode, you can only access to non-interactive functions, being the emission/receipt and  the encryption/decryption functions.
To work in an automated way, SOFiE has created during your first login the basics for the Batch mode usage.
These basics consist in:

Batch update and JAR packages

The JAR packages used by the batch mode are stored in the special folder "SOFIE_HOME/lib".
The first time the batch mode is started, all JAR packages are downloaded from Sofie's server by Wget in "SOFIE_HOME/lib".
Each time the batch mode is started, a check and update (if needed) of the JAR packages is done to ensure you run the last version.

Notice:
If you use a proxy server, the option "Use browser settings" has to be set to "false" in "SOFIE_HOME/properties/communication/communication_default_http.properties".
Instead, specify the proxy parameters manually in the properties file, as wget cannot retrieve the browser parameters.
The properties file cannot interpret proxy configuration script like Pac or wpad files.

Batch Mode Execution

To execute the batch mode, start the script "run_batch_<user_ID>.bat" (on Windows) or "run_batch_<user_ID>.ksh" (on Unix/Linux).

Notice:
If the property "run.forEver"(see batch properties) is set to "No", running the batch starts the SOFiE application and the latter is stopped when there is no more file to treat.
Setting the property to "Yes" keeps the application running, checking periodically (see "waiting.time" parameter) if new files are available and process them.

Custom Batch

You can also edit the script file manually to create your custom batch.
The command pattern to put in your script is call _run lu.cetrel.sofie.client.SofieMain <parameters list>

Parameter Allowed Values Default Description
-mode gui
batch
gui Execution mode.
In batch execution, the value must be always batch (GUI is the default value used to run the GUI application)
-user <user_ID> Profile that has to be used to run the batch
-file <file_name> Name of the file that has to be treated
-e Encrypt.
Only if a filename is present.
This option can’t be used with -d
-s Send file.
Only if a filename is present
-d Decrypt file.
Only if a filename is present.
This option can’t be used with -e
-ctx Production.
Test
Context to use for file transfer.

Example

Rules

The following rules must be followed when using the batch mode otherwise an error will occur:

Batch Properties file: Parameters Description

The parameters are described here.

Notice:
By default, the sending and receipt functions are disabled in the batch properties file.

Tracking The Batch Processing Using The Error Folder

When the processing of a file has failed, the file is moved in one of the subdirectories of folder <SOFIE_HOME>\error and a specific log file is created within the subdirectory.
The file is renamed when moved in the error folder i.e. a timestamp that represents the time when the error has occured is added at the end of filename.
The log file has the same name than its corresponding error file but the extension ".log" is added in the filename.
The subdirectory whithin the file and log are created depend on the error context:

Tracking The Batch Processing Using The Return Code

Also in batch mode, SOFiE is generating messages that are put in the same log as the user-interface execution.
When stopping, SOFiE is returning a system code, indicating whether file(s) have been treated without errors. The values of the return code are: