Mapping issue - doclist getting converted into doc

Product/components used and version/fix level:

Designer 10.3 , IS 10.3

Detailed explanation of the problem:

As per xsd, document gets created
abc>def>xyz
Looped over def and mapping
xyz to tempxyz for mapping convenience.

Once I link xyz list to tempxyz list, it creates document same as xyz and existing document structure gets updated with document instead of doclist. It’s a huge mapping service and initially created on version 9.x (not sure).

I deleted document and recreated it, it will look good but in pipeline during debug it shows xyz[1], post mapping it shows xyz[0] after coming out of tempxyz loop.

  1. How doument structure is getting changed if I am modifying mapping. XSD docs are defined in different package.
  2. In which scenario doclist can drop its element, without explicit modification.
  3. Why it’s showing doclist and doc at same nested level instead of doclist only? Like below
    xyz
    xyz
    If I don’t map it will show only xyz .

How to rectify this mapping bug??
Note- square brackets for list got converted into

Error messages / full error message screenshot / log file:

Question related to a free trial, or to a production (customer) instance?

Please share the screen shot of the LOOP step and properties. And how each record that is created from the source list gets mapped to the target.

I’d give generalized guidance or ask more specific questions but I don’t want to create confusion. Need to see the actual steps and properties of the LOOP to be able to give solid advice.

1 Like

not possible to share exact code, I hope you can find relevant information.
I am doing any change to existing Loops, its as it is. Only adding one step to modify it, which is breaking it.

With that much redacted, impossible to see any issue. Cannot see what the source doc is (other than it is a doc) nor what it is mapped to.

If it appears to you that the LOOP and the steps withing are the issue, please share the properties of the LOOP – the Properties tab for it. The properties shared for the MAP step don’t tell us much of anything. If it is the steps before the LOOP that you suspect, share those.

Perhaps when masking/blurring the steps/field, you can mask just the part that identifies the company/system. And leave the var names visible?

On a side note, whenever there are multiple SEQUENCE blocks in a FLOW service, that may be an indication that it is doing too much. It may be advisable to apply modularity concepts and split some of the steps into logical sub-services that this service can call.

3 Likes

Unfortunately any part of the name of the document is not visible.
What I can tell from the pictures, there is a list you are trying to loop through, and it is not converted to a single element. But in order to make that happen you need to add that list to loop service. That part is not visible either but I don’t see a loop in your list either. For me it is impossible to tell what you are trying to do and what you have done so far.

If you deleted the document which is referenced in a map service loop, and created again and after that the service no longer look the same: This usually happens when their names mismatch. When you delete a document and add it again, they have to have the same including path. Since we can’t see it we can’t tell what is wrong about it.

Other than that I don’t think anyone can help you without getting extra information. Please explain what you are trying to do step by step, not your solution attempt. Start with what is your task please.

2 Likes

It was modular but over the time, some part of code is became too huge due to different developers. I am planning to do that if there is no solution.

There are two scenarios and same code is getting executed
for scenario 1 - expected output for sourceList[2] is targetList[2] - Working
but in scenario 2 - expected output sourceList[2] is targetList[2] - Not Working. Getting only targetList [1]

In Debug mode I saw difference in doc structure [docList converted to doc or only one record is retained] or DocList is not getting mapped. Tried to fix it in various ways.
Thanks for your time, let me know if you have other way to catch the bug for this kind of situation or what can cause it.

In Image both are referring to same docType generated by XSD import, but expected is docList.
I added only one map step, that is arrowed in image and altered exiting document.

I have seen this kind of situation when outside maps moves inside the loop which generates mix of mapping using doc and docList [To fix it - Remap], but here its happening before the loop.

Thank you for your time and response, kindly check my response.
Its not about loop as I am mapping one DocList to another DocList.

If you are mapping 1 to 1, check input and output documents of your loop. There might be a typo. Better copy and paste them again and see if it makes any difference. If you are pushing the results in to another list, you can use
pub.list:appendToDocumentList instead.

I feel like (have to feel it since dont provide your loop) this is supposed to be your input or your output and the problem is the non array version is not this guy.
image

That usually happens when there is a typo in your loop output/input OR when you have another list that is conflicting with your loop. Check all the parrents and make sure there aren’t any other lists in the path. If there is one and if its definitely a single element within an array, you can take that object out by index mapping.

Without extra information, we are shooting blindly. Can you do what @reamon said?

1 Like

This would seem to indicate that something is off when the source doc list is created – in some cases it is not a list. I think you mentioned that’s what you see in debug. Check how the XML string is being parsed to an IS document var. There may be a mismatch in the doc type definition and the actual XML string that is being parsed, assuming the node to document specifies a doc type name.

Hi,

when your document contains lists under a list object, remember to have nested LOOPs.

First loop over the outmost list and in this loop (iteration) loop over the next level list.
When using temp items remember to drop them in the last step of the iteration (or at earliest as possible) to avoid mix ups between different list entries.

When assigning an output list to the LOOP step the output list will be same length as the input list.
If this is not the case, you will have to use assignToDocumentList as suggested by Engin.

You might want to consider to move the mapping of the inner lists to dedicated services to reduce the complexity of the main outer loop for readability.

I agree with Rob Eamin and Engin Sarlak that we would need more details about your document structure and a more detailed service outline for further assistance.

Regards,
Holger

2 Likes

Hi Everyone,

I am still trying to fix the bug.
All the suggestions and feedback are correct and I tried to implement it, but none of them are working.

Size of flow.xml is 40MB. Which is a subset of mapping logic.

Trying to find all mapping releted to Doclist/Doc and removing it to fix double reference of document.

Issue : there are 3 vars with same name in same map step

  1. ABC as doclist reference - doc1
  2. ABC doc as reference - doc2
  3. ABC list without reference (ghost kind of) - doc3

In same map step developer dropped doc2 and mapping doc1 to temp doc1.

During instep debugging of map step temp doc1 got generated , but it was getting dropped when drop step is getting executed for doc2. It’s expected.

Mapping is unordered inside the map step, due to this it’s working for x data sets but failing for y data sets.

I tried to drop doc2 in seperate map step, but mapping get’s failed for all scenarios. As doc1 and doc2 are present in source document.( as shown in previous attached image)

One more deference is
doc1 is having a namespace and
doc2 doesn’t.

These are my findings till date. I appreciate all your help and time. I apologise as I am unable to share more details/screenshot due to data issue :confused:.

So now I need to find the mapping where broken doc reference is present which is creating it.

Suggestions and advices are welcome to find trouble making mapping in this huge flow service.

Hi Vivek,

indeed, 40MB is quite huge for a flow service.

As already suggested, split out some of the map steps to dedicated flow services and invoke them from master service.
Another option might be to create a new empty flow service and copy/paste the content of the existing service there.
Hopefully this would clean up the ghost variables.

Sometimes it can happen that mapping links get broken during save, which in turn leads to “ghost” variables in the service.
To find the locations where the ghost variable is present you will have to open the XML in an Texteditor and search for ABC.
This can be cumbersome for such a big service when this is the main document name.

Regards,
Holger

1 Like

Did you validate your XML file using the document you have in your IS? May be your document or your message is broken/not valid.

1 Like

Hi,

the built-in service pub.xml:schemaValidate can help here.

See IS Built-In-Services Reference for details.

Regards,
Holger

Tried to validate schema and both sets are generating same kind of error. Its a huge schema with recurring call to many self docs. Used as generic one so no schema validation before mapping.

I am trying to duplicate service by copying step by step to identify issue + creating sub services to reduce the size in new flow service.

Will keep you posted about what are the findings.

Thank you

1 Like

Also use a 3rd party tool to validate the schema (so that you won’t have an error because of a wrong configuration parameter). If they are both failing that means message is invalid. Notepad++ can also do validation if you install xml tools plugin.

1 Like

Hi Vivek,

can you provide us the error message fo rthe schema validation, please?

Hopefully, you have created the doc type node(s) and the schema node itself by importing them from a provided XSD file.
Did you try to verify this XSD with an external XML schema editor to check if it is wellformed?

When you say you have many self docs inside your message you should consider to split out the mapping for these self docs to explicit services for each self doc type.

Whenever possible use DocTypeReferences when defining variables in the pipepline as this guarantees, that they reflect the doc type changes properly when the doctypes and schema are dropped and recreated when ever there are changes to the underlying XSD.

Regards,
Holger

Hi Engin and Holger,

I am using XMLSpy so its a well formed XML.
I forgot to mention one more information. Issue identified in PROD package v1.10, but when we tried to reproduce the error in PP it was working absolutely fine with version 1.13. there was no fix or change to that section of code. Than we tried to check in QA and bang, error got generated.

So we can rule out issue for the XML issue as I am taking data from PROD and its working fine except its generating docList of 2 instead of 4.

If there is malformed XML it will fail without going forward.

Error - [ISC.0082.9009] Child element MessageNumCollection at position 46 is unexpected

Hi Vivek,

in this case the XML might look wellformed syntactically, but it is not wellformed semantically.

You have an element in the structure, which is not defined to be present there.
Either this is just an ordering issue, which occurs on PROD and QA, but not on PreProd.
Or it is a more severe issue like element in wrong hierarchy level of the document, which will be hard to detect with the informations we currently have from you.

Which version of your package are you running on QA?
Did you compare the affected service/package in Designer across QA, PreProd and Prod?
Eventually there were changes to it you did not notice yet.

Are the instances differing regarding Fix Level, customized extended settings etc.?

Regards,
Holger

2 Likes

Hi Holger,

We fixed it by a workaround,

  1. dropped document in all the previous steps and saved it without creating mapping for list to list to remove variables.
  2. Restored canonicals package to restore document lists.
  3. Now we can see list in the canonicals and mapped it.

Raised a SI with SAG, how can mapping package overwrite the schema of document of different package?

We tried it in IS 10.3 and 10.15