[General Task Samples] Script Task

This recipe shows how you can use script in a job.

Steps taken:

  1. 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
  2. Add an Echo task under the job as follows and enable it:*****************************************************************************************************
    Starting Batch ${JobNumber} at ${= java.util.Date()} …
    3.****************************************************************************************************
  3. Add a Script task under the job as follows and enable it:println(“Script Task : File Count = ${FileCount}”);
  4. 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
  5. Add an Echo task under the job as follows and enable it:Ending ${JobNumber} at ${= java.util.Date()} …
  6. 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)