While developing business processes in TIBCO Designer, often we need to run external commands like Operating System commands to perform certain actions. TIBCO External Command Activity can be used 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:
I would like to display all the BW Processes up and Running and alert if its not running, can I do this using Engin command . Your advise
Hi Ajmal,
Kindly, help me on how to encrypt file using gpg commands in tibco bw.
Thanks & Regards,
Satish B
i want to run the multiple commands in single external commands like
SFTP connection establishment
SFT P get command
how to do it
i dont want use the SFTP plugin and java code
Dear Krishnarao,
You can write a shell script and get it executed through “External command” palette activity. Thanks
how to move particular formated files from one directory to another directory [ after moving source files should be delete from source directory]
Dear Kiran,
You can create a shell script having mv command to move the file to another directory and then call it using external command activity.
Alternatively, if you don’t want to use linux commands; you can use file palette activity copy file to copy the file to new location and then use remove file activity to delete from the source folder.
Hi Ajmal,
How to run a shell script file with input parameter (like “./flows.sh suspend”) and print the the result in file.
Thanks in Advance.
Regards,
Vinay
HI,
I tried the Same command but i got the error-invalid number of parameters.
return code-4.
how to remove the error?
Same above command i have placed in .sh file and i tried to run but i am getting below error please help!!
CreateProcess error=193, %1 is not a valid Win32 application.
at com.tibco.plugin.cmdexec.CmdExecActivity.a(Unknown Source)
at com.tibco.plugin.cmdexec.CmdExecActivity.eval(Unknown Source)
at com.tibco.pe.plugin.Activity.eval(Unknown Source)
at com.tibco.pe.core.TaskImpl$SeparateThreadEval.run(Unknown Source)
at com.tibco.pe.util.ThreadPool$ThreadPoolThread.run(Unknown Source)
Dear Raaj,
The example command is for windows environment and make sure that you use corresponding linux commands if you are running a shell script. Thanks
Please tell how we can use the external commands using the web service in tibco bw.
with the Linux scripts/ linux commands
Executing python script using external command it’s working fine in tibco designer but same when deployed it give error “Error executing external command python E:\Faher\MFSBatchErrorFiles\filewriter\writer.py: java.io.IOException: Cannot run program “python”: CreateProcess error=2, The system cannot find the file specified. Job-10 Error in [Services/MFS/MFSBatch-Timer.process/External Command] Error executing external command python “.
Can anyone help why it’s not running on administrator (deployed).
Dar Faher,
Make sure that file is present on the given path and permissions are given to the user.
Hello,
I am currently working on a project that needs to download/upload files from server to local maachine. Since the server is not FTP server, I will be using External Command (CMD ssh/scp). I can download the files manually using the command ‘scp user@server:/home/test.txt C:\Users\’ however, this will require to manually input password. I tried to add sshpass but this is not recognized by the machine.
Any idea how can download/upload files via External Command?