I have some requirement here to generate a dynamic target file (Flat file) with a naming convention defined on the session run.
The scenario is, i am to run a session that will be taking the back up of some source on a daily basis. And this shall be placed as a flat file on a every day basis. Here i have to make sure i have the last 5 day backup of the source data.
Something like, File_Day1..File_Day2..File_Day3..File_Day4..File_Day5 and finally on day6 the source has to get saved back on the file 'File_Day1', kind of a looping. I have tried it using the Mapping Variable and tried looping but look to be stuck some where.
Any help is appreciated.
This can be achieved with the help of workflowvariables,decision task and assignment task.
At the start of the workflow check the value of the workflowvariable ,if it is 5 then assign the values as 1 to the workflow variable.Use that variable in the session TGT file name .
This way it will reset the value of the variable when it reaches 5 and overrite the first file.
Thanks Sasi. This worked as a magic.
There was one thing that i was struck, and for others to refer - As Sais had suggested i went on to create a flow with a Decision task (to check on count), accordingly two flows (1. to take count as it is if count<5, 2. to rest the count if it is 5).
Both flows coming into the session task, where i did a flaw - we have a property "Treat Input Link as: AND (or) OR", by default was AND. So we have to set it to OR to have the logic run as per Sasi's suggestion.
Thanks and Regards,