on 01-11-2006 4:37 AM
<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 = H1failed else if h2 = x then status = H2failed
else if I1 = x then status = I1failed else if I2 = x then status = I2failed.</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 dont know where to change the context.
Can somebody help me with this issue.
Thanks in advance .
Disney.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I was able to do it with the graphical mapping using standard functions only.
The output will have only one status , the place where the 1st error shows up..like it checks in header fields first, then it takes items one by one.
It is very big though & would be much simpler to do something like what stefan proposed.
Just for info this is the Text Preview for the Mapping i did...(Is there a way, if i have this to upload to a mapping?)
/ns0:MT_TRGT/Header=/ns0:MT_SRC/Header=
/ns0:MT_TRGT/Header/H1=/ns0:MT_SRC/Header/H1=
/ns0:MT_TRGT/Header/Status=iF(iF(const(), stringEquals(/ns0:MT_SRC/Header/H1=, const()), iF(const(), stringEquals(/ns0:MT_SRC/Header/H2=, const()), const())), not(stringEquals(iF(const(), stringEquals(/ns0:MT_SRC/Header/H1=, const()), iF(const(), stringEquals(/ns0:MT_SRC/Header/H2=, const()), const())), const())), ifWithoutElse(not(stringEquals(iF(concat(const(), index(/ns0:MT_SRC/Item/Items/I1=)), stringEquals(/ns0:MT_SRC/Item/Items/I1=, const()), iF(concat(const(), index(/ns0:MT_SRC/Item/Items/I2=)), stringEquals(/ns0:MT_SRC/Item/Items/I2=, const()), const())), const())), iF(concat(const(), index(/ns0:MT_SRC/Item/Items/I1=)), stringEquals(/ns0:MT_SRC/Item/Items/I1=, const()), iF(concat(const(), index(/ns0:MT_SRC/Item/Items/I2=)), stringEquals(/ns0:MT_SRC/Item/Items/I2=, const()), const()))))
/ns0:MT_TRGT/Items=/ns0:MT_SRC/Item=
/ns0:MT_TRGT/Items/Item=/ns0:MT_SRC/Item/Items=
/ns0:MT_TRGT/Items/Item/I1=/ns0:MT_SRC/Item/Items/I1=
/ns0:MT_TRGT/Items/Item/I2=/ns0:MT_SRC/Item/Items/I2=
Thanks,
Renjith.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You need only one status message for all cases.
Clarify
Regards
Piyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Piyush,
Thanks for the response.
Yes, if the header element fails , then the satatus should be "headerelement failed", but if it dosent fail(ie , if it dosent have the value 'x') then
the 1st element of the Line item (unbounded) is checked, if it fails then status should be "element1 failed " etc.
It works fine if we have only one line item,
but since it is unbounded I am struggling to introduce the context change.
Thanks.
Disney.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.