cancel
Showing results for 
Search instead for 
Did you mean: 

Different structure file with same file name

Former Member
0 Kudos

Hi Experts,

we are picking the ISO format file from Bank  SFTP server and processing to ECC system.

Now Bank is also placing one more ISO format file(different structure) with same file name in same folder and they confirmed that it is not possible to change the file name and folder.

Now we are getting Mapping Exception in PI with the new ISO format structure file.

can any one tell us , how to differentiate among the two files.

Regards

Raju

Accepted Solutions (0)

Answers (4)

Answers (4)

PavanKumar
Active Contributor
0 Kudos

Hi Peddaraju,

If you want to process the same file name disable Duplicate File Checking in sender sftp adapter, it will allow to pick the same file.

Regards

Pavan D

vicky20691
Active Contributor
0 Kudos

Hi Peddaraju,

1. you may need to write a java mapping.

2. This is the approach I have for you

     i)  The inbound processing tab in ICO or sender agreement uncheck the Software Component Version ie. keep the SWCV blank

   ii) The above point will make your sender file passthrough and will not check for structure. It will not throw error Interface determination did not yield or any other error .

   iii) now create a java mapping which will determine the further conditions for you.

Regards,

Vikas

Former Member
0 Kudos

hi Nikhil,

It is a XML placing in the Folder.

-raju

manoj_khavatkopp
Active Contributor
0 Kudos

Raju,

If you want to avoid failure at mapping level then you can have XML validation enabled in your sender agreement .

On more thing want to know so you have 2 different XML files with same name but different structure do you have 2 different interfaces created for these ?

Br,

Manoj

former_member190293
Active Contributor
0 Kudos

Hi Peddaraju!

Do you need to use both file types in one scenario?

Regards, Evgeniy.

Former Member
0 Kudos

hi Manoj,

Yes , two different XML files with same name  and structures are different.

-raju

Former Member
0 Kudos

hi Evgeniy,

No, we are planning to use new scenario for new structure.

-raju

former_member190293
Active Contributor
0 Kudos

What's the difference in your structures?

New scenario means different receiver/interface or anything else?

Regards, Evgeniy.

nikhil_bose
Active Contributor
0 Kudos

Then compare fields in the files and use different target interface and operation mapping.

former_member190293
Active Contributor
0 Kudos

I would try with creating common type including both structures under one root tag and occurence 0..1 for both of it.

<ns0:MT_Common xmlns:ns0="urn://test_ns">

     <ns1:MT_Type1 xmlns:ns1="urn://test_ns1"> (Occurence 0..1)

          ...

     </ns1:MT_Type1>

     <ns2:MT_Type2 xmlns:ns2="urn://test_ns2"> (Occurence 0..1)

          ...

     </ns2:MT_Type2>

</ns0:MT_Common>

In file sender channel I would use MessageTransformBean with XSL transformation to fill the message part according to source message structure.

<?xml version='1.0'?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

                                           xmlns:ns0="urn://test_ns">

<xsl:template match="/">

     <ns0:MT_Common>

          <xsl:copy-of select="."/>

     </ns2:MT_Common_Structure>

</xsl:template>

</xsl:stylesheet>

And actually ... that's all. You'll have source message filled with data of one of your types and during further processing you are able to determine receiver/interface from message contents.

IF //ns1:MT_Type1 Exists Then ...

or

IF //ns2:MT_Type2 Exists Then ...

Regards, Evgeniy.

nikhil_bose
Active Contributor
0 Kudos

Instead of FCC in the communication channel, better to write an adapter module to read those files.

- Nikhil Bose