cancel
Showing results for 
Search instead for 
Did you mean: 

File Validation

former_member186851
Active Contributor
0 Kudos

Dear Scn Users,

The scenario is File->Proxy.

File server will have one .dan file and 4 other files.

If the .dan file is present then the 4 files should be picked and processed.

How to achieve this? Should I use NWBPM or any module or any other technique?

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

What is the transport protocol for file adapter is NFS or FTP because additional files option is available for only NFS not for FTP.

Or if the sender already have SFTP service enbales then you can use SFTP adapter instead of FILE adapter because SFTP adapter also support additional files option, normally both services are available in the server.

Check this blog for how to configure additional files

Dont forget to specify the parameter <AdditionalFile>.optional = NO then it treat it as mandatory file.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Praveen seems to be a nice trick,

And I my case its SFTP So guess can use this option.

And I dont want to process that .don file which is in place,just wish to delete is ter a way to do that as well using this approach?

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

If you use additional files option all the files you mentioned in additional files are comes as attachment to main payload.

There is no option to delete particular file in adapter level, you need to remove the unwanted attachment using java mapping before sending it to Proxy.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Ok Praveen,,

I am planning to do scenario like below

SFTP------->PI---------->Soap AXIS(Attachements)

File--------->PI--------------->Proxy

But axis is adding some kind of message ID in the folder name

So its diififcult to make the file channel pick from that folder since its not fixed.

anyways to handle this?

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

If you want split the interface into two interfaces? Then you can create it like below.

1) SFTP -----> PI -------> SFTP (PI application server)

2) File(PI Application server) ------>PI ------> PROXY

The reason for SFTP instead of SOAP with axis SFTP adapter can write the attachments also to the target directory with the same attachment name.

In the receiver SFTP adapter you need to select Store attachments like below

And set the advanced parameter like below for keep the same attachment name in the target directory. 

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Great Praveen,

good Idea,

Is there way to handle the smae using FIle adapter?I mena attachaments?

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

File receiver adapter does not support attachments, you need to create four separate channels to write the files into target directory, and you need to use PayloadSwapBean to swap the particular attachment to main payload and write the file to target, you still need to handle the dynamic file name using Dynamic configuration.

I think your PI server is enabled SFTP service, if you have SFTP better to use SFTP instead of file adapter.

Regards,

Praveen.

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

If you interested to use custom adapter module you can do this in one interface, check Eng blog below.

SFTP----->PI---->PROXY

In sender SFTP adapter you need to configure the module to split the attachments into multiple messages so you will receive 5 messages in total,

the other message which you don't want you can ignore it in PI without sending it to ECC.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Ya Praveen,

SFTP is better,it wil write the attachements in the same directory menioned in the SFTP channel right?

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

Yes the attachments are written in the same directory which we mentioned in the channel.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Thanks Praveen,

Willl try and get back.

former_member186851
Active Contributor
0 Kudos

Praveen,

If I have the same file which just a sequnce how to add in SFTP additional files?

I tried all with %SEQNUM,Nothing is working.Any clue or idea.

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

You want to configure additional files in sender SFTP adapter for same file with sequence number? can you give me the example file names you want to configure so that i can help.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Hello Praveen,

Main file name

ABC_Timestamp.done

Additional files

ABC_Timestamp_01.txt

ABC_Timestamp_02.txt

ABC_Timestamp_03.txt

ABC_Timestamp_04.txt

Then number of files might vary.

former_member182412
Active Contributor
0 Kudos

Hi Raghu,

Is timestamp same for all the files including main file and additional files? if yes you can use below logic to define the additional files in sender SFTP adapter.

All these additional files are static and fixed number of files(if you mention 4 files it will only work for 4 files), it is not going to be dynamic number of additional files.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Ok Praveen,

got it,I guess this is the only drawback.

Answers (1)

Answers (1)

suchitatomar
Participant
0 Kudos

Hi,

The best way would be to use a script that will move the required file from original folder to say folder PI once the dan file is created.

Thus PI can pick the required file from the new folder.

You could use "additional files" in channel. Then the file will not be read until all required files are available.

Regards

S Tomar

former_member186851
Active Contributor
0 Kudos

Tomar,

Guess script wont be a better option.