This recipe shows how you can use script in a job.
Steps taken:
- Create a job file (ScriptTask.job). Add the following parameters for this job:Param Name=JobNumber, Value=EXR000156, Enabled=true
Param Name=FileCount, Value=0, Enabled=true - Add an Echo task under the job as follows and enable it:*****************************************************************************************************
Starting Batch ${JobNumber} at ${= java.util.Date()} …
3.**************************************************************************************************** - Add a Script task under the job as follows and enable it:println(“Script Task : File Count = ${FileCount}”);
- Add a FileLoop task under the job as follows and enable it:Name=ElixirSamples
Folder=repository:/ElixirSamples
Recursive=true
Parameter Name=FileNameAdd the following File Criteria for the FileLoop task:Test=Extension, When=Matches, Value=rml - Add an Echo task under the job as follows and enable it:Ending ${JobNumber} at ${= java.util.Date()} …
- Run the job and view the output on the “Logs” tab.
To download the necessary files for this recipe, refer to the attached ZIP package.
ScriptTask.zip (3.4 KB)