cancel
Showing results for 
Search instead for 
Did you mean: 

2 input files

Former Member
0 Kudos

All,

We have a scenario - where there are 2 input files. One is the data file - "Datainbound07102007.txt" and the other is the indicator file - "Datainbound07102007Complete.txt".

The second file is there to indicate that the first file has been downloaded and complete. The requirement for us is, check for the existence of the indicator file and if it is there, pick the data file.

Since we will be using 2 separate communication channels - how can we control this and prevent the communication channel for the data file pick the incomplete file?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Set up you first File communication channel to wait for the file "Complete.data".

Then set up your second File communication channel to wait for "Datainbound07102007Complete.txt".

In the second communication channel there is a setting "Run Operating System Command After Message Processing.

Put in the value:

mv Datainbound* Complete.data

for unix systems or

ren Datainbound* Complete.data

for windows systems

This will rename your data file to the name expected by the first communication channel.

I hope this is clear.

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

This would probably be easier if the indicator filename was part of the data filename.

So:

indicator: "inbound07102007.txt"

data file: "datainbound07102007.txt"

Then you could probably do the following:

mv data%f complete%f

where "%f" represents the name of the indicator file.

henrique_pinto
Active Contributor
0 Kudos

thezone,

if your only requirement is to guarantee that the file is only picked up when it is fully sent, just use the <i>Msecs to Wait Before Modification Check</i> parameter in <i>Advanced Mode</i> of Sender File adapter. Use a reasonable interval (half a second would be long enough).

If you do want to use the 2nd file in the control logic, use a BPM with 2 receivers steps, each one getting the files from a different sender file adapter, and use proper File Name masks in order to receive the correct files in each adapter.

Regards,

Henrique.

Former Member
0 Kudos

Ok, i just checked with the external system. Here is their naming convention. The data file is named as "datainbound07102007.txt" and the indicator file is named as "datainbound07102007.cmp".

From XI perspective, once we get the "datainbound07102007.cmp" file, we need to rename the data file's name from "datainbound07102007.txt" to "XIdatainbound07102007.txt" (prefexing the actual name of the data file with XI)

Hope this clarifies the question even further.

Thanks.

Former Member
0 Kudos

In the unix command, how do we maintain the date stamp suffix properly?

Example - Assume, we get 2 files in a day "Datainbound07102007.txt" and "Datainbound07102007-2.txt" and their corresponding indicator files also.

What post processing command should we use on the indicator file's communication channel to rename the 2 data files as follows, (adding the word FULL to the end of the file before the datestamp)

"DatainboundFULL07102007.txt" and "DatainboundFULL07102007-2.txt"

Thanks.

prabhu_s2
Active Contributor
0 Kudos

try for the option with adapter modules using the concpet of dynamic file name. let the file path point to Datainbound07102007.txt if the file naming convetion is standarised like having "Complete" tagged to the end to mark the completion of the datafile then in module check if this Datainbound07102007Complete.txt exists. If yes refer FileName to the Datainbound07102007.txt else not found append "Complete" to the file name Datainbound07102007 making it as Datainbound07102007Complete.txt . In this case the CC will not truigger until the file is present. All these are controlled in coding part & Hope this might work

Message was edited by:

Prabhu S

Former Member
0 Kudos

I also think its far simpler than having to develop a BPM.

Former Member
0 Kudos

Hi,

Here BPM looks to be better option, because you have persist data of one file to pick the data of the other file.

Regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

use a bpm. first recv step for indicator file. if this file is present the CC is triggered and hence the BPM. following another recv step for data file. this will ensure the process is followed. set the correlation accordingly.

Former Member
0 Kudos

This is how it is, first the external system starts writing the "Datainbound07102007.txt". This file might take sometime, once it completes the data file. It writes the "Datainbound07102007Complete.txt" (this is an empty text file). This file indicates that the external system has completed writing the data file and it is not in between.

Since communication channels just monitor the FTP location for the presence of the file - how can we make them wait till another file is present.

Even if we use ccBPM - as suggested with 2 receive steps - first one for indicator file and the second for data file. Wont the COMMUNICATION CHANNEL pick up the data file as soon as it sees it? (even though the indicator file is not there?)

Thanks.

prabhu_s2
Active Contributor
0 Kudos

the first recv step only initiates the BPM and not the second one. only when both the recv steps are placed in a fork the processing are independant of eachother. hence in ur case this shud not be a problem as u will have the recv steps one after the another. in this way till the Datainbound07102007Complete.txt is traced the CC is not going to fire and at the sametime the BPM will not be initated until a message is recv inside the IP

Former Member
0 Kudos

Let me try to understand this.

you are saying unless the BPM is active (which happens by the presence of the indicator file, as this would be the start process step), the 2nd communication channel wont pickup the data file even if the file is there.

i thought generally - the communication channel picks up the file based on the polling interval and tries to determine the receiver. In this case, it wouldnt find any - since there is no instance running and would error out. ("No receiver case" or something similar)

Thanks.

prabhu_s2
Active Contributor
0 Kudos

the second CC picks but processing happens only when the correlation condition is satisfied. this is what i meant. until the corelation condition is satisfied the message will be in wait sate for bpm

Message was edited by:

Prabhu S

Former Member
0 Kudos

but wont the second CC, pick up the incomplete file? (this is the scenario which we are trying to avoid).

Thanks.

Former Member
0 Kudos

hi,

wouldn't the temporary filename option in the file adapter be helpful so that it takes care that the file with actual filename is always complete

prabhu_s2
Active Contributor
0 Kudos

okie. u dont want to pick until the file is processed? i misunderstodd ur requirement. in that case a workaround is to make use of OSS commands. letme check for other option and keep u posted

Former Member
0 Kudos

Hi - can you elaborate please? This is a incoming file to XI. So where can we set the temporary file name option?

Thanks,