Execute Shell Command executes system command or a shell script.
This task is used is used in Chapter 22, Scheduling, Chapter 24, Listeners, and Chapter 21, Manual Task Execution.
Table 20.3. Attributes of "Execute shell command" task
Task type | "Execute shell command" |
Start on | Node IDs to process the task
This attribute is accessible only in the cluster environment. If there are nodes specified, the task will be processed on the first node which is online and ready. |
Shell script | Command line for execution of external process. |
Working directory |
Working directory for process. If not set, working directory of application server process is used. |
Timeout | Timeout in milliseconds. After period of time specified by this number, external process is terminated and all results are logged. |
Figure 20.2. Web GUI - shell command
Some parameters are available only in particular context: scheduling, event listeners, or manual task execution.
Table 20.4. Parameters of "Execute shell command" task
event | Event that has triggered the task |
now | Current date-time |
task | The triggered task |
user |
Object representing user who executed the graph/jobflow.
It contains sub-properties that are accessible using dot notation
(i.e. ${user.email})
|
Table 20.5. Parameters of "Execute shell command" task - available in scheduling
schedule |
Object representing the schedule that triggered this task.
It contains sub-properties that are accessible using dot notation (i.e. ${schedule.description})
|
EVENT_USERNAME | Username of the user who caused the event. |
EVENT_USER_ID | Numeric ID of the user who caused the event. |
EVENT_SCHEDULE_DESCRIPTION | Description of the schedule. |
EVENT_SCHEDULE_EVENT_TYPE | Type of the schedule - SCHEDULE_ONETIME or SCHEDULE_PERIODIC. |
EVENT_SCHEDULE_ID | Numeric ID of the schedule |
EVENT_SCHEDULE_LAST_EVENT | Date-time of the latest schedule triggering (in java.util.Date.toString() format). |
Table 20.6. Parameters of "Execute shell command" task - available in listeners
run |
Object representing single graph/jobflow execution.
It contains sub-properties that are accessible using dot notation
(i.e. ${run.jobFile}).
|
sandbox |
Object representing a sandbox containing the executed graph/jobflow.
It contains sub-properties that are accessible using dot notation (i.e. ${sandbox.name})
|
tracking | Object represeting status of components in a graph execution. It contains sub-properties that are accessible using Velocity syntax for loops and conditions. |
EVENT_USERNAME | Username of the user who caused the event. |
EVENT_USER_ID | Numeric ID of the user who caused the event. |
EVENT_RUN_SANDBOX | Code of the sandbox containing the graph/jobflow. |
EVENT_RUN_JOB_FILE | Sandbox-relative path to the graph/jobflow file. |
EVENT_RUN_RESULT | Current status of the graph/jobflow execution
|
EVENT_RUN_ID | Numeric ID of the run record representing graph/jobflow execution |
EVENT_TIMEOUT | Specified timeout (in milliseconds) for the TIMEOUT event to occur. |
EVENT_JOB_EVENT_TYPE | Graph event that triggered the task
|
Table 20.7. Parameters of "Execute shell command" task - available in manual task execution
parameters | Task parameters - container for String-String key-value pairs passed to this task. |