While developing business processes in TIBCO Designer, often we need to run external commands like Operating System commands to perform certain actions. TIBCO provides External Command activity to execute operating system commands from inside a BW process.
In this tutorial, you will learn how you can run operating system command to copy files from one folder to another. This project is being developed in Windows platform so I will be using Windows OS command. If you are working on Linux/Unix environment; you need to run the commands which are available in your Operating System.
Step 1: Decide the command to run using External Command activity
For this tutorial, I am going to run XCOPY windows OS command which is used to copy files from one folder to another. I have some files in a folder named original from which I wish to copy files to another folder named backupfolder. Command to do this copy operation is as follows:
XCOPY D:\ExternalCommandTest\original D:\ExternalCommandTest\backupfolder /m /e /y
Step 2: Write TIBCO BW Process to run External Command
In this step, I am going to create a process in TIBCO Designer for running the above command.
The command to run is specified in command filed in the Input Tab as you can see below:
Step 3: Test TIBCO Process to run External Command
Once the process has been implemented and validated successfully, load the process in designer tester and start it. As you can see below, process has run successfully and the file from the source path has been copied to the destination path: