on 04-30-2008 2:24 PM
Hi,
I'm facing to a problem with the good management of Context.
For once, each try I done with "UseOneAsMany" was unsuccessfull... Maybe I need to a SortbyKey...
If you have time to help me.
Source
item_10
... field_10_A
... field_10_B
... field_10_C
item_20
... field_20_A
... field_20_B
... field_20_C
item_30
... field_30_A
... field_30_B
... field_30_C
etc...
Wanted target: for each Item, I generate LineA, LineB, LineC
//------- info of item 10 ----
Line_A
.... field_10_A
Line_B
.... field_10_B
Line_C
.... field_10_C
//------- info of item 20 ----
Line_A
.... field_20_A
Line_B
.... field_20_B
Line_C
.... field_20_C
//------- info of item 30 ----
Line_A
.... field_30_A
Line_B
.... field_30_B
Line_C
.... field_30_C
Note: there is no special level for an item, we just have:
LineA // of item 10
LineB
LineC
LineA // of item 20
LineB
LineC...
And my current Target is something like that...
//------- info of item 10 ----
Line_A
.... field_10_A
Line_A
.... field_20_A
Line_A
.... field_30_A
Line_B
.... field_10_B
Line_B
.... field_20_B
Line_B
.... field_30_B
Line_C
.... field_10_C
Line_C
.... field_10_C
Line_C
.... field_10_C
So:
LineA // of item 10
LineA // of item 20
LineA // of item 30
LineB // of item 10
LineB // of item 20
LineB // of item 30
etc... group by LineX and not one after the other.
Thanks
Mickael
It is not possible to have alternating nodes in XML after mapping and though the content conversion of the file adapter is able to handle this, I am not even sure if there is any way to describe such a structure with xds.
As workaround I have once created a structure with middle nodes which can be transformed with the MessageTransformbean (as the transformation here works different as in the file adapter channel):
helpernode
Line_A
.... field_10_A
Line_B
.... field_10_B
Line_C
.... field_10_C
helpernode
Line_A
.... field_20_A
Line_B
.... field_20_B
Line_C
.... field_20_C
helpernode
Line_A
.... field_30_A
Line_B
.... field_30_B
Line_C
.... field_30_C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And what about the source nodes? Are the named also equal? And the elements different? Like:
node
- A
- B
- C
Then you can have something like this:
...
result.addValue(A);
result.addValue(B);
result.addValue(C);
...
then use node - udf - TLINE
node - udf - splitbyValue - TLINE
This is only a sketch, I have not tested this.
Regards
Stefan
Hi Stephan,
thanks you for your help, that help me to solve this issue.
The right solution is:
1. create a UDF with:
result.addValue(A[0]);
result.addValue(B[0]);
result.addValue(C[0]);
2. Then use it like that:
node - udf - removeContext - E1TXTRW (raw , Line_X)
node - udf - splitbyValue - TLINE (field_nn_xx)
Regards.
Mickael
Hello Mickael,
Just go through this imp blog..
/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13
Thanks,
Satya kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.