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

(1) Create a job

  1. Select > JOBS > File Event Jobs.

  2. On the File Event Jobs page, select Add.

  3. 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)

  4. 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.

  5. 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.

  6. 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.

  7. In step Summary, confirm that the settings are correct, and then select Finish.

(2) Turn on the job

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.

(3) Upload the input.csv file

  1. Select > SERVICES > Storage.

  2. On the Storage page, select the data folder.

  3. Select Upload File file.

  4. In the Open dialog, specify input.csv, and select Open.

    When the CSV file is uploaded, the CSV Creation Monitoring job should be executed.

(4) Check the log

  1. After the job was executed, select > JOB EVENTS > File Event Jobs.

  2. 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.

(5) Turn off the job

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 .