cancel
Showing results for 
Search instead for 
Did you mean: 

XI Mapping

Former Member
0 Kudos

Mapping Experts:

I have an issue trying to map the scenario below, I tried all kinds of combinations (contexts, splits, etc) but I can not seem to make it work.

Did any of you had a similar mapping?

Thanks a lot in advance for your help,

Marc

Source Record

<Record>

Document Number

Name

Home City

Home State

Other City

Other State

</Record>

Target

<IDOC>

<Header> 0...1

Document Number

Name

<Mail> 0...1

City

State

<Other> 0...9999

City

State

Example Source Data:

001 Richard Smith Tampa FL Boston MA

001 Richard Smith Tampa FL Salem MA

001 Richard Smith Tampa FL Albany NY

002 Mary Wilson Denver CO Amarillo TX

002 Mary Wilson Denver CO Plano TX

Desired Result:

<IDOC#1>

<Header>

001

Richard Smith

<Mail>

Tampa

FL

<Other>

Boston

MA

<Other>

Salem

MA

<Other>

Albany

NY

</IDOC#1>

<IDOC#2>

<Header>

002

Mary Wilson

<Mail>

Denver

CO

<Other>

Amarillo

TX

<Other>

Plano

TX

</IDOC#2>

Accepted Solutions (1)

Accepted Solutions (1)

former_member214364
Active Contributor
0 Kudos

Hi Marc,

I assumed min and max occurrences of all elements under <Record> node are 1.

if you have source structure as

SourceMsg 1..1

--Record 0...unbounded

-


Document Number 1..1

-


Name 1..1

-


HomeCity 1..1

-


HomeState 1..1

-


OtherCity 1..1

-


OtherState 1..1

and Target structure as

IDOC 0...unbounded

--Header 0..1

-


Document_Number 1..1

-


Name 1..1

--Mail 0..1

-


Home_City 1..1

-


Home_State 1..1

--Other 0..9999

-


Other_City 1..1

-


Other_State 1..1

Do Message mapping as follows(<b>Note:</b> S - Source T - Target)

1.Document Number(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed] ->collapseContexts -> IDOC(T)

2.Document Number(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed] ->collapseContexts -> SplitByValue[Each Value] ->Header(T)

3.Document Number(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed] ->collapseContexts -> SplitByValue[Each Value] ->Document_Number(T)

4.Name(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed] ->collapseContexts -> SplitByValue[Each Value] ->Name(T)

5.Document Number(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed] ->collapseContexts -> SplitByValue[Each Value] ->Mail(T)

6.HomeCity(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed] ->collapseContexts -> SplitByValue[Each Value] ->Home_City(T)

7.HomeState(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed] ->collapseContexts -> SplitByValue[Each Value] ->Home_State(T)

8.use <b>formatByExample</b> Node function

it accepts 2 inputs as follows

First input is <b>Record</b>(S) node

2nd input is Document Number(S)[Change context to <b>SourceMsg</b>] ->SplitByValue[Value Changed]

Then output of <b>formatByExample</b> node map to <b>Other</b>(T)

9. OtherCity(S)->Other_City(T) and

OtherState(S)->Other_State(T).

Please let me know if you have any issues with this mapping.

Cheers,

Jag

Former Member
0 Kudos

Hi Jag,

Yes, playing with the contexts as you mentioned worked for my scenario.

Thanks a lot for your help!

Marc

Answers (0)