TIBCO Tutorial: How To Run Operating System Commands In TIBCO BW Processes

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:

tibco run external command

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:

TIBCO External Command Activity

Ajmal Abbasi

Ajmal Hussain Abbasi is Integration Consultant By Profession with 13+ years experience in Integration domain mainly with TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Cloud, TIBCO Flogo, TIBCO Mashery, TIBCO Spotfire, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in various sectors by using his skills in TIBCO Flogo, TIBCO API Management (Mashery), TCI, Tibco Designer, TIBCO Business Studio, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi has experience with MuleSoft ESB as well. Ajmal Abbasi is also experienced in the area of API Management particularly with WSO2 API management platforms. Ajmal Abbasi is also experienced in developing solutions using Core Java and J2EE Technologies. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn - YouTube

15 thoughts on “TIBCO Tutorial: How To Run Operating System Commands In TIBCO BW Processes

  1. Abraham

    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

    Reply
  2. B Satish

    Hi Ajmal,

    Kindly, help me on how to encrypt file using gpg commands in tibco bw.

    Thanks & Regards,
    Satish B

    Reply
  3. krishnarao potti

    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

    Reply
    1. Ajmal Abbasi Post author

      Dear Krishnarao,

      You can write a shell script and get it executed through “External command” palette activity. Thanks

      Reply
  4. kiran bairi

    how to move particular formated files from one directory to another directory [ after moving source files should be delete from source directory]

    Reply
    1. Ajmal Abbasi Post author

      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.

      Reply
  5. Vinay

    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

    Reply
  6. Bhavani

    HI,

    I tried the Same command but i got the error-invalid number of parameters.
    return code-4.

    how to remove the error?

    Reply
  7. Raaj

    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)

    Reply
    1. Ajmal Abbasi Post author

      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

      Reply
  8. Rajat

    Please tell how we can use the external commands using the web service in tibco bw.

    Reply
  9. Faher

    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).

    Reply
  10. MJ

    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?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *