Checking the working hours

This section explains how to check whether the time when the script was called is in a working day, and whether, if it is in a working day, the time is in the working hours, using the template shown below. This section explains the procedure for starting the script from the external program 'ScriptRunner.exe' using the command line, not from a trigger.

Script name:

Check Working Hours

 

The procedure for setting the template in HULFT Script is shown below.

1. Preset required settings.

2. Load a script template and change its settings.

3. Generate XML for executing script.

4. Check operation.

Presetting required settings

Copy the file 'holiday-settings_en.csv' that defines Holiday Settings and the working hours into HULFT Script file system so that the file can be viewed from HULFT Script. The file "holiday-settings_en.csv" is stored in the setup module (\template\eng) for HULFT Script products. Refer to HULFT Script HELP for details on HULFT Script file system.

Loading script template and changing its settings

1. Load a script template to the project.

Load the script named 'Check Working Hours.'

For example, the project to which the script is to be loaded is named 'project.'

Refer to Loading a script template for detailed procedures.

2. In Script Canvas, check the processing flow from the Start component icon through the End component icon.

3. Save the created project by selecting File > Save project in Designer.

4. Register the created script as a service by selecting File > Register project as service in Designer.

This completes the procedure for setting the loaded script.

= Remarks =

At this point, you can check actual script operations by clicking Run > Run in Designer.

When an error occurs, refer to HULFT Script HELP.

Generating XML for executing script

Generate an XML file for executing script. This file is used as a command line argument.

The procedure for creating this file is explained below:

1. Open Designer.

2. Right-click the script 'Check Working Hours' in Project Explorer, and then click Output XML for executing script in the pop-up menu.

3. Specify a file name ('timer.xml' in this example) in a folder to the XML file for executing script, and click Save.

This completes the procedure for generating XML for executing script.

Checking operation

Use the saved XML file for executing script as an argument to run 'ScriptRunner.exe.'

Example:
$HULFTSCRIPT_HOME\server\bin\ScriptRunner.exe C:\timer.xml
C:\timer.xml:

XML file for executing script

Check whether the time when the script was called is in a working day, and whether, if it is in a working day, the time is in the working hours. Then, confirm that the check results are logged to the specified log output destination.