cancel
Showing results for 
Search instead for 
Did you mean: 

Split Source Message to Multiple Files

Former Member
0 Kudos

I would like generate a new file in the File Adapter for each instance of the <Payload> in the source XML message. The source XML message has a looping <Payload> field.

Example:

Incoming XML Message sent via SOAP over HTTP (SOAP Adapter):

<Root>
     <Header>
     </Header>
     <Payload>
          <Instance>First</Instance>
     </Payload>
     <Payload>
          <Instance>Second</Instance
     </Payload>
     <Footer>
     </Footer>
</Root>

Expected Output:

2 fixed width files - one for each Payload (FCC in the File Adapter)

These are the changes Iu2019ve done so far:

1. In the IR, Message Mappingu2019s Message tab, change the occurrence of the message type from 1 (by default) to 0........unbounded

2. In the IR, Interface Mapping, change the occurrence of the target interface from 1 (by default) to 0........unbounded

3. In the ID interface determination, change the type of interface determination from Standard to Enhanced

Problem:

But it's only generating one file in the output for the first instance of the <Payload>. What am I doing wrong? Do you have any other solutions?

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kristine

Did you test with message mapping test tab?

If yes, what is the output you are getting getting in test tab?

Is message type repeating multiple times if field <payload> repeats?

Thanks

Sai

Former Member
0 Kudos

Did you test with message mapping test tab?

Yes, I tested the message mapping but the destination is empty and the queues are also empty.

If yes, what is the output you are getting getting in test tab?

The output is empty. It just shows

Messages
     Message1

Is message type repeating multiple times if field <payload> repeats?

No, the message type doesn't show at all in the message mapping test. However, if I test using SOAPUI, XI creates an output file for the first <Payload> only.

If I did the mapping correctly, will I be able to see the message type twice in the message mapping test output if I have 2 Payloads in the source? Thanks.

Please verify my mapping:

SOURCE                      TARGET
Payload (1..unbounded)  -> SplitByValue[Each Value] -> PCPricing_PCP_File (0..unbounded)
     Identifier (1..1)  ->  LabelRecord (1..unbounded)
         PCPLabelId (0..1) -> trim -> mapWithDefault[] -> LabelId
     Premium (0..unbounded)  -> Premium (0..unbounded)
         RecId (0..1) -> trim -> mapWithDefault[] -> RecId

Former Member
0 Kudos

yes you should be able to see the message type two times in the output.

Now you have one field message type with 0.. unbounded. First of all You need to map this field and this field should repeat when payload field in source repeats.

Thanks

Sai

Former Member
0 Kudos

Where should I map the PCPricing_PCP_File (0..undbounded field) in the source?

Am I using the SplitByValue(Each Value) function correctly? Do I need to use SplitByValue(Each Value) in the child nodes of PCPricing_PCP_File as well?

Is there any other function I need to use like CollapseContexts?

Sorry for all the questions. Thanks for your help in advance!

Edited by: Kristine Tiongson on Sep 23, 2008 12:58 AM

Former Member
0 Kudos

PCPricing_PCP_File is the message type of target. Am i correct?

In this case you may not need to use any node functions like split by value. Just verify all nodes are mapped correctly or not and test again.

Thanks

Sai

Former Member
0 Kudos

Thank you for your suggestions, but it didn't work. Any other ideas?

Thanks.

Former Member
0 Kudos

Could you please give your source message type, target message type and message mapping after you have changed to 0..unbounded?

Check again all fields mapping because once you change from 1 to 0..unbounded, all mapping will be lost. You need to map again.

Thanks

Sai

Former Member
0 Kudos

I did remap all the fields after changing the target to 0..unbounded.

Here's my message mapping from source to target:

Messages 1..1                                           Messages 1..1
  Message1  1..1                                          Message1 1..1
    PePCPricing 1..1
      Payload 1..unbounded -------------------------------  PCPricing_PCP_File 0..unbounded
        Indentifier 1..1   -------------------------------    LabelRecord 1..unbounded
          PCPLabelId 0..1     ----------------------------      LabelId 1..1
          PCPFileNumber 0..1      ------------------------      FileNumber 1..1
        PremiumDescription 0..unbounded ------------------    PremiumDescription 0..unbounded
          RecId 0..1       -------------------------------      RecId 1..1
          BusUnit 0..1     -------------------------------      BusUnit 1..1

Note that the Messages, Message1 and PePCPricing fields are not mapped to anything.

I think there is something missing from my mapping because the output of my MessageMapping test in the target is just this (without the MessageType PCPricing_PCPFile):

Messages 1..1  
     Message1

In addtion, the queues show SUPPRESSED.

Why am I not seeing the MessageType in the output and why are the queues SUPPRESSED? Please advise.