cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in context changing ( message mapping )

Former Member
0 Kudos

<u>source structure </u>

Message Name

Header(1)

H1

H2

LineItem(1)

Item(1-unbounded)

I1

I2

<u>target structure</u>

Message name

Header(1)

H1

status

LineItem(1)

Item(1-un)

I1

I2

The result for status should be as follows

<i>if h1 = x then status = ‘H1’failed else if h2 = x then status = ‘H2’failed

else if I1 = x then status = ‘I1’failed else if I2 = x then status = ‘I2’failed.</i>

Problem :

It works perfect as long we have only one Item (Unbounded Tab).

But since it is unbounded we have more than one item tabs.

The mapping does not produce the status element.

I tried removing the context of all the source fields, but still I coudnt produce the status element. I don’t know where to change the context.

Can somebody help me with this issue.

Thanks in advance .

Disney.

View Entire Topic
stefan_grube
Active Contributor
0 Kudos

Hi Disney,

I could not find a solution with standard.

It works with following user defined function (advanced function, cache the whole queue):


public void checkValueInQueue(String[] a, String[] b, ResultList result, Container container) {

  for (int k = 1; k < a.length; k++) {
    if (a[k].equals(b[0])) {
      result.addValue("true");
      return;
    }
  }
  result.addValue("false");

}

Assign this function for I1 and I2 instead of equalS

I1 or I2 are first vale, constant(x) is second value.

Hope that helps,

Stefan

Former Member
0 Kudos

Hi stefan,

Thanks a lot for your help.I dont have words to express my joy, I have been working on this for the last 3 days and i coudn't find a solution.

Your code absolutely fixed my problem. Thanks a lot again, for your timely help.

Regards.

Disney.