Run deliveries
You can run deliveries on runtimes, either from the command line, or from Semarchy xDI Analytics.
Refer to Manage runtime deliveries for more information about starting deliveries from xDI Analytics
Prerequisites
To run a delivery, you must first install the modules it depends on to the runtime, so the runtime can communicate with external technologies.
Refer to Add modules to Semarchy xDI Runtime to learn how to install a module to a runtime, and to Install and manage modules for more information about modules.
Run a delivery from the command line
You can find two scripts in the runtime installation directory to run deliveries:
-
startdelivery.sh|bat
: Thestartdelivery
script executes a delivery in a standalone Java process, without needing an active runtime. -
startcommand.sh|bat
: Thestartcommand
script connects to an active runtime, and executes a delivery with the execute delivery command. See Execute delivery for more information about this command.
You should invoke these scripts directly from within their directory, or set the XDI_RUNTIME_HOME
environment variable to the runtime installation directory ahead of time.
If you want to optimize resource usage, you should use the startcommand script, as additional Java processes use up more resources. |
Start delivery script
The start delivery script has two main syntaxes to start a delivery by its name or by its file name.
./startdelivery.sh -name [DELIVERY_NAME]
./startdelivery.sh -file [DELIVERY_FILE]
The start delivery script is synchronous, and has the following return codes:
-
For Windows:
-
0
: The session was completed successfully. -
-1
: The session did not complete successfully. -
-2
: The session was stopped by a user.
-
-
For Linux/Unix/macOS:
-
0
: The session was completed successfully. -
255
: The session did not complete successfully. -
-2
: The session was stopped by a user.Refer to Exit Codes With Special Meanings for more information about return codes for Unix.
-
Variables
You can pass session variable values to the delivery, to then use during execution. Use the following syntax for the script:
./startdelivery.sh -name [DELIVERY_NAME] \
-var [VARPATH1] [VALUE1]
...
-var [VARPATHN] [VALUEN]
Use the following syntax in the process:
${VARPATHN}$
The following example shows the use of a variable named var1, at the process root.
./startdelivery.sh -name myDelivery \
-var ~/var1 value1
${~/var1}$
Configuration
When working with multi-configuration deliveries, you can pass the configuration to use for the execution using the following syntax:
./startdelivery.sh -name [DELIVERY_NAME] \
-configuration [CONFIGURATION_NAME]
Session name
By default, the session name is the same as the delivery name. You can set a specific name for the session using the
./startdelivery.sh -name [DELIVERY_NAME] \
-sessionName [SESSION_NAME]
Repository
If your runtime is configured to use a deliveries repository, you can provide the repository name. The delivery is searched in the specified repository.
./startdelivery.sh -name [DELIVERY_NAME] \
-repository [REPOSITORY_NAME]
Return code path
You can retrieve the path of a session variable that contains the code returned by the script when the execution completes.
./startdelivery.sh -name [DELIVERY_NAME] \
-returnCodePath [VARIABLE_NAME]
./startdelivery.sh -name MyDelivery \
-returnCodePath CORE_DURATION
./startdelivery.sh -name MyDelivery \
-returnCodePath ~/MyProcess/MyVariable
Log level
You can specify the level of logging used for the session.
./startdelivery.sh -name [DELIVERY_NAME] \
-loglevel [LOG_LEVEL]
Refer to log level for more information on various log level values.