Trading Networks 10.7 | Administering and Monitoring B2B Transactions | Managing File Transfers with ActiveTransfer | Administering ActiveTransfer with Command Central | Managing Actions | Task Configuration Definitions | Execute Script Task Configuration
 
Execute Script Task Configuration
You can configure the following properties for the Execute script task:
Field
Description
Task name
Type a unique name for the task.
File filter
Type the name of the file if you want to filter files with specific names. By default, ActiveTransfer Server considers all files. If you want to use regular expression, specify a valid regular expression in File filter and select Use regular expression option.
Note:
You can use wildcard characters to filter the file names. For example, type *.zip to trigger the action only when ZIP files are uploaded or downloaded. To trigger an action based on a name string in the ZIP files, use the name string in the File filter box, preceded and followed by wildcard characters. For example, type *invoice*.zip to trigger the action based on the file URLs, when ZIP files containing the character string invoice in their file names are uploaded or downloaded. If you define a File filter for a task, the task acts only on files that are filtered out.
Few examples for regular expressions are:
*(.(?!purchaseorder))*: Excludes files with the file URL containing purchaseorder.
**/out/.*: Include files with the file URL containing the folder out.
*^abc(.*)123$: Includes anything that starts with abc and ends with 123. Matches abc123, abcxyz123, but not abcxyz123def.
*NEW-((*.doc)|(*_backup_*)): Includes anything starting with NEW- that either ends in .doc, or is followed by the string _backup_.
Command
Type a command. Keep in mind that running a batch (.bat) file requires running cmd.exe at a command prompt and passing it the arguments to execute the batch file.
Arguments
Type the command’s arguments. For example, enter {real_path}/archive/{name}:. If the file is uploaded to /uploads/stuff.zip, it will be copied to /archive/stuff.zip.
Separator
Type a regular expression to separator arguments.
Working directory
Type the path to the directory where the command will be executed. For example, when an application searches for a resource such as a configuration file, the application searches in the location specified here.
Note:
Make sure the path ends with “/” to identify the location as a folder and not a file.
Execute error task
Select this option to execute an error task if the file operation fails. For more details, see Error Task Configuration.
You should configure the execute script task properties depending on your operating system. An example each for the Windows and Unix/Linux platforms are listed as follows:
*Windows Platform: If you want to execute the batch file C:\SAG\batchfiles\test.bat, the properties that you need to specify for the execute script task are:
Command  C:\Windows\System32\cmd.exe
Argument  /c;start;test.bat
Separator ;
Working Directory  C:\SAG\batchfiles\
*Unix/Linux Platforms: You can directly specify the script file name. If you want to execute the batch file /home/data/batchfiles/test.sh, use the following properties in the execute script task:
Command /bin/bash
Argument test.sh;arg1;arg2
Separator ;
Working Directory  /home/data/batchfiles
The above configuration properties can vary depending on the specific operating system that hosts your ActiveTransfer Server. In some of the operating systems, you might require an exit command at the end of the script file to properly terminate the command process.
The “execute script” task runs a script for each file in the list that is passed on to the task by the previous task. The script should be available in the same location as the files. The script is run on the machine on which ActiveTransfer is installed. The execute script task waits for the script to complete execution before passing on the control to the next task. The script that is executed as part of this task should include an exit command so that the execution control is transferred back to ActiveTransfer. This task does not modify the list of files from the previous task.