Cannot do transformations on items in a record

Hi …

I’ve created an Flow Service where I take an XML string as an input converts it to a record using “stringToDocument” and “documentToRecord”. I then do a “MAP” step, where I want to replace some (String) elements in the record. As the last step in my Flow Service I do a recordToDocument to create a new XML String as the final output from my service.

But I won’t work as I’ve hoped. When i map (String) elements in my record (in the MAP STEP) nothing seems to happen. If I try to “harcode” a value into one of the elements a new record is created with that one element.

Does anyone know why this happens, what I’m doing wrong or have any other tips for me ??

Hi, Kjell.

Can you provide more details? Specifically:

    []What are your mappings in the stringToDocument step? []What are your mappings in the documentToRecord step? What are your mappings in the recordToDocument step?
    [/list]

    Provide the name of your pipeline variables and to which variable you map them in each respective service’s Service In. Do the same for the Service Out variables.

    Your steps are absolutely correct so my hunch is that you missed a mapping somewhere.

    Thanks.

Hi …

First of all, thanks for your quick response. I’ve tried to explain what I’m doing here:

I map my XML string to xmldata of StringToDocument, and leave all other service inputs default. I’ve keep the default mapping from node to node in the Service Out to Pipeline Out mapping, and I also drop my inData from the PipeLine Out.

I’ve then leave the default mapping of node to node for the Service Input mapping for documentToRecord. For the output I map the boundNode to my output record (named Message). I’ve also drop the node, makearrays, recordname and boundNode from the PipeLine Out.

For the mapping step I only map the fields I want to change from the record (Message) in PipeLine In (for my testing I just try to substitue to variables, map action to version and version to action) to the record (Message) in PipeLin Out. I’ve also tried to map each field in the input record to the output record, but that didn’t seem to make a difference.

For the recordToDocument i map my record (Message) from the PipeLine In to boundNode of the recordToDocument. I also set the enforceLegalXML to true, and leave all other as default. I’ then map the xmldata element of Service Out to my XML out variabel.

Hope this helps you to help me …

Hi, Kjell. It look like you have a good handle on the physical steps to perform your task. I think that your problem lies with your XML document mapping to a BoundNode.

When your BoundNode is created and it does not match your target Record, your map will be goofed.

Getting familiar with BoundNode takes time, but here are some steps you can try to debug.

  1. Create a 4th step to your Flow in which you map BoundNode to your target record. You can delete this mapping from Step #3. []Press F7 to step through your Flow, checking the results tab at each step. Remember that F7 always steps to before the service invocation. []Before step #4, look at your BoundNode in the results tab. Does it have the same structure as your target record? Likely not.

If you see that your pipeline has a variable named “BoundNode” whose only subnode is the root node of your XML document, you can make a quick fix.

If this is, indeed, true, do the following:

    []In the documentToRecord step, go to the Service Out variable and select BoundNode. []Click the “Insert” icon (4th from the left on the Pipeline tab) and insert a Record. []Name the Record as the XML document root node []Map the BoundNode’s subnode that you created to the Pipeline Out variable BoundNode. Make this map explicit (i.e. draw the line). You can also map it to a target Record in the Pipeline Out, if you want. In the recordToDocument step, map the BoundNode (or your target Record) from Pipeline In to the Service In variable BoundNode.
    [/list]

    This should help you to draw out your Record from beneath the BoundNode and the results tab will show the variable xmldata with your properly formatted XML document.

    If you need a better description of how to peform these tasks, be sure to ask.

    Thanks.

Thanks …

This solved my problem. Now everything seems to work ok.

Hi All,
Can anyone help me with mappings to Xcbl Standards.when i map Xcbl Dtd to IDoc structure the data is not populating at all and the IDOC segments is showing null values.

can anyone help me.
thanks in advance,
Shankar

Shankar,

Based on you query it sounds like it is a mapping problem only,that is why the IDOC segments are populating with null values.So please do step thru each map step and check the loops,conditional mapping etc…unittest the mapping and let us know if you find any technical problems mapping to idoc structures.

HTH,
RMG

Hi RMG,
Thanks for ur reply . I changed the mapping and i’m getting the values in Xcbl format . One more issue is the data in Xcbl i’m getting as per mappings. but when there is more than one line item in an order i’m not getting the data correctly i.e . for the first item the data is populated properly . But for the next items i’m getting the repeated values. I have attached the Xcbl file . Can u please guide me .

Thanks in advance,
shankar


ORDERSxCBL.xml (9.2 k)