Creating External Operations to Run Scripts Through the Portal
An external operation
enables you to run shell scripts (for example, .sh or .bat files)
through the portal and schedule these actions through portal jobs.
For example, you might want to create a script that queries documents,
pings portal servers, e-mails snapshot query results to users, or
runs some other custom job, then create an external operation that
points to the script, and use a job to run the script on a specified
schedule.
To create an external operation you must have the following
rights and privileges:
- Access Administration activity right
- Create External Operations activity right
- At least Edit access to the parent folder (the folder that will
store the external operation)
- At least Edit access to the job that will run this external operation
Important:
- Because the standard error output from the command or script is
captured to the job log, avoid the use of new shells, redirects, and
pipes.
- Passing arguments to cmd or start in shell programs might disable the time-out mechanism.
- When you are extending scripts in the External Operation Editor,
carefully consider all potential effects of the scripts. Make sure
that your script does not introduce a security risk.
- Click Administration.
- Open the
folder in which you want to store the external operation.
- In the Create Object drop-down list, click External
Operation.
- In the Operating System Command box,
type the relative path and file name of the script enclosed in quotes
(").
Important: All external operation scripts must reside
in the scripts directory of each of the Automation Services that will
run them. The scripts directory is located on the computer that hosts
the Automation Service, in the AquaLogic User Interaction installation
directory (for example, C:\bea\alui\ptportal\scripts). The Automation Service will not run any scripts that are not in
this directory.
The following tokens in the command line will
be substituted:
- names of environment variables surrounded with percent signs (%)
- <user_id>
- <security_token>
- <job_id>
- <operation_id>
- <last_job_runtime>
Expanded tokens that contain spaces or special characters which
are not surrounded with quotes (") are enclosed in quotes automatically.
- In the Time-out in seconds box,
type the number of seconds after which, if this operation is still
running, you want the job to stop.
If you do not want to set a time-out, leave this setting at 0 (infinite).
To run this operation, you must associate it with a job and
schedule the job to run.