Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Introduction
Parameters can be set for jobs, orders and for job chain nodes.
...
An environment variable of the form:
- $SCHEDULER_PARAM_[PARAM-NAME] (Unix™)
- %SCHEDULER_PARAM_[PARAM-NAME]% (Windows™)
can be used to read any parameter in a shell script.
Parameters in a shell script can be added and modified using:
- echo "[PARAM-NAME]=[PARAM-VALUE]" >> $SCHEDULER_RETURN_VALUES (on Unix™ systems)
- echo
echo [PARAM-
NAMEh1.NAME]=[PARAM-VALUE] >> %SCHEDULER_RETURN_VALUES% (on Windows™ systems)
Check to see if the testParam parameter, described in the last Kapitel (page 28), has been set. As an example of the reading and writing of parameters, modify the scripts of the quickstart/firstOrderJob andquickstart/secondOrderJob Jobs as follows:
Code Block
...
@echo off echo %SCHEDULER_JOB_NAME% processed %SCHEDULER_ORDER_ID% echo Current Timestamp: %DATE% %TIME% echo Parameter testParam = "%SCHEDULER_PARAM_TESTPARAM%" echo Parameter testParam is modified to "123456789" echo testParam=123456789 >> %SCHEDULER_RETURN_VALUES% exit %ERRORLEVEL%
Example: firstOrderJob for Windows™:
Code Block |
---|
#!/bin/sh
echo "$SCHEDULER_JOB_NAME processed $SCHEDULER_ORDER_ID"
echo "Current Timestamp: `date`"
echo "Parameter testParam = \"$SCHEDULER_PARAM_TESTPARAM\""
echo "Parameter testParam is modified to \"123456789\""
echo "testParam=123456789" >> $SCHEDULER_RETURN_VALUES
exit $?
|
Example: firstOrderJob for Unix™:
Code Block |
---|
@echo off
echo %SCHEDULER_JOB_NAME% processed %SCHEDULER_ORDER_ID%
echo Parameter testParam = "%SCHEDULER_PARAM_TESTPARAM%"
dir .\config\live\quickstart
exit %ERRORLEVEL%
|
Example: secondOrderJob for Windows™:
Code Block |
---|
#!/bin/sh
echo "$SCHEDULER_JOB_NAME processed $SCHEDULER_ORDER_ID"
echo "Parameter testParam = \"$SCHEDULER_PARAM_TESTPARAM\""
ls -l ./config/live/quickstart
exit $?
|
...