Workflow: Loop Through Filelist One at a Time

Workflow: Loop Through Filelist One at a Time

Posted by: Anush Shetty

A workflow implementation to loop through a set of files in a list. Each time the workflow runs, the sessions in the workflow processes data from a single file from the filelist.

Overview

Sometime instead of processing all the files in a filelist in a single session, we may process them one at a time in a workflow. The data from a single file is processed through multiple sessions through a single run of the workflow. The workflow is run again for the next file to be processed. So it is necessary to loop through a set of files in a list for each workflow run. Implementation: Workflow 1Create a mapping to generate a file with a list of files (with full path) and sequence number. Workflow 2In the first session, read a filename form the filelist created in the workflow 1 and create an indirect file with that filename. A workflow variable is to track the file number. It is incremented every time workflow is run so that the next file is processed in the subsequent run. The workflow variable is used in the first session through mapping variable to to lookup the filelist and create the filelist with the single file name.So, each time the workflow 2 runs, one file will be processed from the file list and File_No count will be incremented by 1. In the subsequent run the next file from the file list will be processed.The scheduler of the workflow 2 has to be configured to repeat as many times as the number of files in the list. (Screen shot in the demo tab).To rerun the Workflow2, the persistent workflow and mapping variables (of session 1) should be reset. Download File Contents:
  • Workflow XML
  • User Guide

Features

System Requirements

  • Informatica PowerCenter 9.1.0 and above.
  • Window and Linux.

Resources

Support