cancel
Showing results for 
Search instead for 
Did you mean: 

message mapping--Context related

Former Member
0 Kudos

<b>Input file:</b>

<?xml version="1.0" encoding="UTF-8" ?> 
- <Group01>
  <Field1>A1</Field1> 
  <Field2>A1_B1</Field2> 
  <Field3>A1_B1_C1</Field3> 
  </Group01>
- <Group01>
  <Field1>A1</Field1> 
  <Field2>A1_B2</Field2> 
  <Field3>A1_B2_C1</Field3> 
  </Group01>
- <Group01>
  <Field1>A1</Field1> 
  <Field2>A1_B2</Field2> 
  <Field3>A1_B2_C2</Field3> 
  </Group01>
- <Group01>
  <Field1>A2</Field1> 
  <Field2>A2_B1</Field2> 
  <Field3>A2_B1_C1</Field3> 
  </Group01>
- <Group01>
  <Field1>A2</Field1> 
  <Field2>A2_B2</Field2> 
  <Field3>A2_B2_C1</Field3> 
  </Group01>
- <Group01>
  <Field1>A2</Field1> 
  <Field2>A2_B2</Field2> 
  <Field3>A2_B2_C2</Field3> 
  </Group01>

<b>Output file</b>

<?xml version="1.0" encoding="UTF-8"?>

   <Group1>
      <Feld1>A1</Feld1>
      <Group2>
         <Feld2>A1_B1</Feld2>
         <Group3>
            <Feld3>A1_B1_C1</Feld3>
         </Group3>
      </Group2>
      <Group2>
         <Feld2>A1_B2</Feld2>
         <Group3>
            <Feld3>A1_B2_C1</Feld3>
         </Group3>
         <Group3>
            <Feld3>A1_B2_C2</Feld3>
         </Group3>
      </Group2>
   </Group1>
   <Group1>
      <Feld1>A2</Feld1>
      <Group2>
         <Feld2>A2_B1</Feld2>
         <Group3>
            <Feld3>A2_B1_C1</Feld3>
         </Group3>
      </Group2>
      <Group2>
         <Feld2>A2_B2</Feld2>
         <Group3>
            <Feld3>A2_B2_C1</Feld3>
         </Group3>
         <Group3>
            <Feld3>A2_B2_C2</Feld3>
         </Group3>
      </Group2>
   </Group1>

Is it possible to do XI mapping without writing any UDF?

Thanks

Shubhankar

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Raj,

A1_B2 is coming twice in your output. I need only one time and under this it should create 2 group3 (A1_B2_c1 and A1_B2_C2).

 <Group2>
         <Feld2>A1_B2</Feld2>
         <Group3>
            <Feld3>A1_B2_C1</Feld3>
         </Group3>
         <Group3>
            <Feld3>A1_B2_C2</Feld3>
         </Group3>
      </Group2>

Thanks for your help.

Regards,

Shubhankar

justin_santhanam
Active Contributor
0 Kudos

Oops!! I'm sorry Shubankar I looked the rule only at Group2 level and not at Group3 level. Lemme figure it out and will update u soon.

raj.

Former Member
0 Kudos

Hi Raj,

As per your suggestion I am getting below output

<?xml version="1.0" encoding="UTF-8" ?> 
- <Group1>
  <Feld1>A1</Feld1> 
- <Group2>
  <Feld2>A1_B1</Feld2> 
- <Group3>
  <Feld3>A1_B1_C1</Feld3> 
  </Group3>
  </Group2>
  </Group1>
- <Group1>
  <Feld1>A2</Feld1> 
- <Group2>
  <Feld2>A1_B2</Feld2> 
- <Group3>
  <Feld3>A1_B2_C1</Feld3> 
  </Group3>
  </Group2>
  </Group1>

I was trying with below rule for Group2

					Field2------------------
									formatByEample  Group2
Field1[Change Context to higher node]--SplitByValue[Value Changed]

and it is almost working and giving the snapshot of my output. You can see same value A1_B2 is coming twice but I am expecting only one A1_B1. that is not happening.

- <Group2>
  <Feld2>A1_B2</Feld2> 
- <Group3>
  <Feld3>A1_B2_C1</Feld3> 
  </Group3>
  </Group2>
- <Group2>
  <Feld2>A1_B2</Feld2> 
- <Group3>
  <Feld3>A1_B2_C2</Feld3> 
  </Group3>
  </Group2>

Thanks

Shubhankar

justin_santhanam
Active Contributor
0 Kudos

Shubankar,

Are u sure, I'm getting the same output as u want. Ok, wait for sec lemme show the results to you and reply whether the result meets your criteria.

Please see the results :http://www.flickr.com/photo_zoom.gne?id=1366578775&size=o

raj.

justin_santhanam
Active Contributor
0 Kudos

Shubankar,

The below logic will solve your issue.

<b>Field1</b>[Change Context to higher node]-SplitByValue[Value Changed]-CollapseContext---<b>Group1</b>

<b>Field1</b>[Change Context to higher node]-SplitByValue[Value Changed]-SplitByValue[EachValue]----<b>Field1</b>

<b>Field1</b>SplitByValue[Value Changed]-<b>Group2</b>

<b>Field2</b>---<b>Field2</b>

If the occurrence of <b>Group3 is 1..1</b> then don't map anything.

If the occurrence of <b>Group3 is 0..1</b> then map like below

Constant[]----Group3

<b>Field3</b>[Change Context to higher node]-SplitByValue[EachValue]-<b>Field3</b>

raj.

Former Member
0 Kudos

Just use direct mapping as follows:

Group01 --> Group1

Field1 --> Feld1

Field2 --> Group2

Field2 --> Feld2

Field3 --> Group3

Field3 --> Feld3

No other Context functions are needed.

prateek
Active Contributor
0 Kudos

Yes it is possible. Just use standard node functions

Regards,

Prateek

Former Member
0 Kudos

Group1 and field1 are working but other groups are not working.

Field1(context to test02)-->SplitbyValue(value changed)-->CollapseContexts-->Group1

Field1(context to test02)-->SplitbyValue(value changed)-->CollapseContexts-->SplitByValue(each value) -->Field1

Now I am trying for Group2 and field2 but still I don't have answer.

If you have any answer then please tell me.

Thanks

Shubhankar