DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Secure File Transfer as a Critical Component for AI Success
  • Effortless Concurrency: Leveraging the Actor Model in Financial Transaction Systems
  • Using Data Diodes for One-Way Information Transfer and Preventing Data Leaks
  • Data Transfer From SQL Server to Excel

Trending

  • The Ultimate Guide to Code Formatting: Prettier vs ESLint vs Biome
  • Agentic AI Systems: Smarter Automation With LangChain and LangGraph
  • Proactive Security in Distributed Systems: A Developer’s Approach
  • How to Format Articles for DZone

How to Read Files and Transfer Them to Other Location Using TIBCO BW 6.5

This article is about reading all files of any type/extension from a particular location and transferring them to other location.

By 
Aman Singh user avatar
Aman Singh
·
Jun. 12, 20 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
8.1K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, we will walk through reading files of any types/extensions from one location and transferring all of them to other locations using Tibco BW 6.

All We Need Are Three Activities i.e.

  1. Timer: This will be our starter activity to start the process, you can have other starter depending on your use case.
  2. ListFile: This List Files activity is a synchronous activity that returns information about files or directories, or a listing of all the files in the specified directory.
  3. RemoveFiles: Remove File activity is a synchronous activity that removes the specified files from the directory. If the specified directory is not empty, it generates an exception.

Our Flow Looks Like

message flow

Message Flow

Let's consider our current location from where we want to read all files is: D:\Tibco\Test-Projects\From-Folder

Let's say the target location where we want to transfer all the files is: D:\Tibco\Test-Projects\To-Folder 

Now Let's Dive Into the Configuration for Each Activity

1. Timer: This activity does not need any configuration until say you want to run it at a specified time interval, otherwise when you debug your process this will automatically start.

2. ListFiles:

ListFiles

ListFiles configuration

You can notice above that in the FileName section I have given value as ("D:\Tibco\Test-Projects\From-Folder\*.* ").  What *.* will do is it will read all files of any types/extension from our current location.

3. RemoveFiles: I have named it in flow diagram as MoveFiles as this activity act as the Cut-Paste process ( it will MOVE the file from one location to another location, NOT copy).

You will also notice that I have put it inside of the "Iterate" group as we will be looping for each file and for each file we will be picking it up and moving it from current location to target location.

Iterate group configuration:

Iterate group

Iterate Group configurations

You will notice Index Name I have given as "i". This will contain the value of the current iteration. Like if we are iterating and picking the first file, then its value will be 1 and so on.

In Variable List we will use this to store all the files picked up by ListFiles activity, that is why the XPath expression above is ($ListFiles/files/fileInfo )

3. RenameFiles(MoveFiles) configuration:

MoveFiles

In fromFileName: We are concatenating the folder location where we are currently picking the files from(“D:\Tibco\Test-Projects\From-Folder\/”), and we are picking the filename of the file on whom the iteration is going on currently with this logic(“$ListFiles/files/fileInfo[$i]/fileName”)

In toFileName: we are concatenating the folder location where we want to send the files to(“D:\Tibco\Test-Projects\To-Folder\/”), and again we will be picking the filename of the file on whom the iteration is going on with this logic(“$ListFiles/files/fileInfo[$i]/fileName”)

** the \/ above is used as escape character to escape "" **

That's all guys, we are done with the process. All you need to do is run it and all files will be transferred.

Transfer (computing)

Opinions expressed by DZone contributors are their own.

Related

  • Secure File Transfer as a Critical Component for AI Success
  • Effortless Concurrency: Leveraging the Actor Model in Financial Transaction Systems
  • Using Data Diodes for One-Way Information Transfer and Preventing Data Leaks
  • Data Transfer From SQL Server to Excel

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!