How to maintain order of fields in record

I have a problem with mapping a record. We need to load the resulting record into a 3rd party load process. The XML file resulting from the mapping has the fields in a different order than the record definition. While this is still valid XML, the 3rd party load process errors out because the fields are not in proper order. Does anyone know how to get webMethods to maintain the same order as the record definition? I have tried mapping the fields in order but the record still gets set seemingly randomly.
Example:

Definition:
ID
DESC
QTY
PRICE

Output:
ID
PRICE
QTY
DESC

Thanks for any help you can give me.

I’m assuming two things:

  1. You’re talking about Integration Server (B2B)
  2. Empty string is acceptable in the four fields you mentioned.

We had a similar problem and were able to get around it by basically “initializing” the record after “declaring” in the pipeline.
Basically, define the record earlier in your Flow, and use the “Set Value…” button to set all of the fields in the record to an empty string (basically just click the “Set Value…” button with the record selected and then click “OK”).

Let me know if that solves your problem.

Curtis

If you are using recordToDocument, make sure you specify a record name in the namespace.

Thanks - I appreciate the suggestion, but that is a lot of work! If this works for you then I am glad to have a way that will work for certain.

I turned this problem in to webMethods Tech Support late yesterday and they came back with a suggestion for me today. It at least works with the small sample package I sent to them yesterday. The problem is when you mix Strings with records and record lists in the highest level of the record hierarchy. If you map the values of the Strings first, then append in the records this problem can happen. They had me move the String level maps to the end after all records had been appended to the highest level and suddenly the Results tab shows the correct order.

This will take a lot of work also to move all the String maps to the end of the mapping, but it is probably less work than setting an initial value in every field.

Glad you were able to come up with a workaround.
Given the workaround that wM Support has given you, I probably don’t understand your problem as well as I thought I did.
Just to clarify, though, I think that my suggestion, if it does in fact work (you should be able to check easily enough) is only a few mouse-clicks, if the structure of your record is already defined.
You really only have to click once on the top-level record (not every individual field), and then click the blue arrow button (labeled “Set Value…”), and then click “OK” when the dialog comes up with your record structure in it.
This definitely works for records that are all strings, but might work less-well for more complex records.
In any case, I’m glad you got it sorted out.

I have redone my mapping and the suggestion from Tech Services has not completely worked. It has improved the order, but not fixed it. So I tried your suggestion and initialized many of the fields and now it works. It was not a simple fix because of the complexity of our record format. Thank you for your suggestion - this forum is very helpful.

I’m glad it helped, Jay.
Sorry it wasn’t as simple for you, as it was for us, but at least we found a work-around for you. :wink:

Curtis

Thanks!

I’ve been struggling with this issue for 2 years. I had been working around by using the “blue-arrow” technique, but that got to be too complicated now that I am working with Rosetta-Net.

Much Appreciated