Execute a script using a file event
This section explains how to create a job to trigger the execution of a script by file creation.
Description
In this scenario, create a file-event-driven job for a script that you created in Create a script that processes a CSV file.
Take the following steps in order to create the job.
Procedures
-
Select
> JOBS > File Event Jobs.
-
On the File Event Jobs page, select Add.
-
In step General on the File Event Jobs > Add New page, configure settings such as the name of a job as shown below, and then select Next.
Field name
Setting (example)
Name
CSV Creation Monitoring
Workspace
Personal
Profile
Choose a profile.
Description
(Optional)
-
In step File event, set the information related to file events as shown below, and then select Next.
Field name
Setting (example)
Description
File events
Create
Directory to monitor
/Personal/data
Monitor directory
Don't select.
If you select Monitor directory, File to monitor is disabled.
File to monitor
input.csv
If File to monitor is empty, you need to select Monitor directory, which allows all files under the specified directory to be monitored.
-
In step Project, set the name and version of the project and the name of the script that you created in the scenario Create a script that processes a CSV file as shown below, and then select Next.
Field name
Setting (example)
Project
sample1*
Version
Set the latest version number.
Script
script*
Script version
Set the dependency relationship of scripts.
Mapping parameters to script variables
Do not add parameters.
*
:
The name and version of the project and the name of the script that you specified in the scenario Create a script that processes a CSV file.
-
In step Service to run scripts, set the HULFT Integrate service to use as shown below, and then select Next.
Field name
Setting (example)
Service to run scripts
Set the HULFT Integrate service name you configured.
-
In step Summary, confirm that the settings are correct, and then select Finish.
On the File Event Jobs page, check that the sign at the beginning of the row of the job you added is . If not, select Turn on job from the action menu for that job to enable the job to be executed.
-
Select
> SERVICES > Storage.
-
On the Storage page, select the data folder.
-
Select Upload File file.
-
In the Open dialog, specify input.csv, and select Open.
When the CSV file is uploaded, the CSV Creation Monitoring job should be executed.
-
After the job was executed, select
> JOB EVENTS > File Event Jobs.
-
On the File Event Jobs page, check the status of the job and the execution history.
By selecting a job and selecting Detail from the action menu, you can view the script execution log.
On the File Event Jobs page, select the job and select Turn off job from the action menu to disable the job if the job is no longer required. Check that the sign at the beginning of the row is .