A question in mapping

[FONT=Arial Narrow][SIZE=5][FONT=Arial Narrow][SIZE=5]

Hello !
I am very new to webMethods Developer… So I am going through webMethods Developer guide. I got question in mapping…
It says
"If you map an array variable to an array variable that has a defined length then the length of source array variable [FONT=PalatinoLinotype-Italic][SIZE=2][FONT=PalatinoLinotype-Italic][SIZE=2]must [/font][/SIZE][/FONT]equal the length of the target array variable. If the lengths do not match, the link will not occur."[/SIZE]

I am unbale find to how to define a length to array in webMethods developer…

[SIZE=2][FONT=PalatinoLinotype-Roman][SIZE=2][FONT=PalatinoLinotype-Roman][SIZE=2][FONT=PalatinoLinotype-Roman][SIZE=2][FONT=PalatinoLinotype-Roman][SIZE=2][FONT=PalatinoLinotype-Roman][SIZE=2][FONT=PalatinoLinotype-Roman][SIZE=2]Thanks in advance

[/size][/font][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/SIZE][/FONT][/SIZE][/FONT]

“An array variable that has a defined length” simply means that the array is not empty :wink:
That’s why you don’t see any “length” parameter.

Ok, if we consider it in that sence then according to the above statement you should not not be able to map an array to another array having different length right.:confused:
But when I tried that, I was able to map an array to another array of different length.:frowning:

wmlearn,

I’m not sure what the doc statement exactly means but this is one mistake that might happen.

Ok, do this small change to your service and see what happens.

  1. In a map step create a document say “targetDoc”, under it create a document array say “targetDocArray” with one string variable under it say “targetVar”. Now populate this with some 3 elements of “targetDocArray[0] - [2]”
  2. In the input of the service create the same structure but named say “sourceDoc” and so.
  3. In the next map step map the “sourceVar” to “targetVar”. Note: map only String variable, not document level.

Now execute the service with some 5 elements in the input document. End of the service you will notice that the last 2 elements from the “sourceDoc” are missing and not mapped to the “targetDoc”. This is because the “targetDoc” has already defined length. At the same time if you do a docuemnt level mapping (targetDocArray–> sourceDocArray) you can see the entire array getting mapped.

This might happen when you are doing some mapping where you ve to create a temp array under a loop using appendToDoclist and then out of loop by mistake if you happened to map the temp array to the publishable doc on variable level and dont drop the target array, you will end up in losing the data which is more than the minimum number of records you mapped earlier. Ok, thats a silly mistake but I have made it!:wink:

Again not sure what the document meant but this is one thing you can keep in mind.

Hope this helps.

I tried what ever you told and it worked also…
thank you so much

I think it only works with documents, not with string array.
Because i tried with string array but didnt work.
So may be that doc statement meant document array not string array

The Developer User Guide is very “bizarre”… I can’t do the second example when the “link not occurs”…
Or maybe I don’t understand there example.