cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Query

Former Member
0 Kudos

Hi All,

I am working on a message mapping.

I am getting the error as cannot produce target element.Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

Can you please help me?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Shwetha,

The Problem may lie in the instance you use.You may find no namespace in the payload or some sml header data may be missing.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

did you check the namespaces of your test document. If they don't match your xsd, the mapping won't work either.

Best Regards

Sven

Former Member
0 Kudos

Hi Shweta,

Can you tell us about the source and target message structure of the mapping?

peter_wallner2
Active Contributor
0 Kudos

Hello Shweta Kullkarni,

I assume your XSD is okay.

- But you should check wether if the element in your source file is empty or maybe does not exist!?

- Also, sometimes if you have wrong context elements are suppressed and then you do not get a target element.

Best regards,

Peter

Former Member
0 Kudos

Check if you have not missed to map any mandatory field (red color field) at target. Also do the mapping of parent nodes (if not done).

Former Member
0 Kudos

Hi Sarvesh,

Thanks for the reply.

Do I need to map the Root node of the structures?

Thanks in advance

Former Member
0 Kudos

As sarvesh suggested- either U have missed the mapping of root node of ur target strucutre check root node mapping.

chirag

former_member208856
Active Contributor
0 Kudos

Also Check the Occurance of Source Structure is matching with Occurance of Target structure.

Former Member
0 Kudos

Hi Sandeep and Chirag,

I have mapped the root nodes and the occurrences of both the structures are same.

But still I am getting the same error.

Can you please help me?

Thanks in advance

peter_wallner2
Active Contributor
0 Kudos

You should look at the queue of the source element - is there a value or is it maybe empty?

Former Member
0 Kudos

can u provide the source n target structure details for further analysis.

chirag

Former Member
0 Kudos

Hi,

Make sure that all teh target nodes and fields with minimum occurence as 1 are mapped with source field or with constant..

Regards,

Pragati

Former Member
0 Kudos

> I have mapped the root nodes and the occurrences of both the structures are same.

>

> But still I am getting the same error.

How you have fed your data in test tab... I guess your test data is not correct.

Expend the nodes & subnodes under test tab and check make sure there is no red nodes/fieds.

Execute your mapping without any test data and see if you get any errors.

former_member200962
Active Contributor
0 Kudos
I have mapped the root nodes and the occurrences of both the structures are same.

If the minimum occurence of the target node is 1 (mandatory) then you dont need to map it....it will be green (by default)

If you are still getting the error (even after mapping all the required/ mandatory fields) then recreate the mapping.

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

Thanks for the reply.

I have created the mapping again but it is still giving the same error.

The occurrence of the field in error is 1:1.

In the mapping there were a few fields ,no value was coming for, so I used the mapwith default function for that.Is it right?

Am I getting the error becaise of the fields for which no values are coming ?

The structure is like

RootNode(Externa Message)

--Node1 1:1

-


Subnode1 1:1

-


SubSubnode1 1:1

-


SubSubSubnode11:Unbounded

-


SubSubSubSubnode1 1:1

-


Fieldinerror 1:1

Can you please help me?

Thanks in advance

former_member200962
Active Contributor
0 Kudos
In the mapping there were a few fields ,no value was coming for, so I used the mapwith default function for that.Is it right?

The min occurence for your fields seem to be 1 .... so they should be mapped and you should ensure that if no source value is coming then either map to blank constant or mapWithDefault

Regards,

Abhishek.

Former Member
0 Kudos

In the mapping there were a few fields ,no value was coming for, so I used the mapwith default function for that.Is it right?

A) Is any mapping is made between those fields whose value is not coming from source is yes then use map with default function. if no mapping is there then use constant function which default value as per the requirement.

chirag

Former Member
0 Kudos

Hi Abhishek,

Thanks for the reply

The min occurence for your fields seem to be 1 .... so they should be mapped and you should ensure that if no source value is coming then either map to blank constant or mapWithDefault

I am mapping the target field with the source field means there is the source field available,but the value for the source field may not be available in the testing payload,so I mapped that source field with mapwithsedault and then mapwith default with the target field.

Can you please help me?

Thanks in advance

Former Member
0 Kudos

Hi Chirag,

Thanks for the reply.

I am mapping the target field with the source field means there is the source field available,but the value for the source field may not be available in the testing payload,so I mapped that source field with mapwithsedault and then mapwith default with the target field.

Thanks in advance

Former Member
0 Kudos

U have done correct- after this also r u getting the same error.

See if ur source field dont have any value coming then in target XML field tag will not be created at all hence in order to create that u use mapwithdefault value which will make sure that target XML field tag will be created with either default value

chirag.

former_member200962
Active Contributor
0 Kudos
I am mapping the target field with the source field means there is the source field available,

No.....this understanding is not correct.....even after mapping the source field the error can occur.

The source field should be present in the test data which is passed to the mapping....this restriction is for mandatory target fields.

but the value for the source field may not be available in the testing payload,so I mapped that source field with mapwithsedault and then mapwith default with the target field.

this is fine....are you still getting the error?

Regards,

Abhishek.

Former Member
0 Kudos

Hi Chirag,

Thanks for the reply.

See if ur source field dont have any value coming then in target XML field tag will not be created at all hence in order to create that u use mapwithdefault value which will make sure that target XML field tag will be created with either default value

I have used the mapwithdefault but still getting the error.Is it because the value is not coming for the source field?

If so,then it will always give an error whenever there is no value coming for the source field even after using the mapwith default.Is it?

Thanks in advance

former_member200962
Active Contributor
0 Kudos
If so,then it will always give an error whenever there is no value coming for the source field even after using the mapwith default.Is it?

have you specified any value for mapping with default?

Former Member
0 Kudos

Hi Abhishek,

The target field is mapped with any of the source fields depending on the condition.

There are values for a few source fields in the testing payload while there may not be any value for some of the source fields,

So I used the mapwithdefault and then mapped those source fields with the target fields.

Thanks in advance

former_member200962
Active Contributor
0 Kudos
So I used the mapwithdefault and then mapped those source fields with the target fields.

I am asking have you specified any default value which should be mapped when the source field is not coming? If input queue is empty (i.e. source not present) then the default value will be used.

The target field is mapped with any of the source fields depending on the condition.

What is the condition?

If the condition returns false then also you will get the error saying that target could not created.....mapWithDefault will also not work then.

Former Member
0 Kudos

Hi Abhishek,

Thanks for the reply.

So I used the mapwithdefault and then mapped those source fields with the target fields.

I am asking have you specified any default value which should be mapped when the source field is not coming? If input queue is empty (i.e. source not present) then the default value will be used.

I have mentioned the default value in the mapwithdefault but there is no value for the source field in the payload.Is it the reason for the error?

Thanks in advance

former_member200962
Active Contributor
0 Kudos
I have mentioned the default value in the mapwithdefault but there is no value for the source field in the payload.Is it the reason for the error?

If there is a condition-check on the source field (as you said earlier) and it this condition-check fails then it will result in error.

Former Member
0 Kudos

Hi Abhishek,

If there is a condition-check on the source field (as you said earlier) and it this condition-check fails then it will result in error.

Means,the error such as cannot creae target element can also occur?

Thanks in advance

former_member208856
Active Contributor
0 Kudos

As per structure in External Definition, all the Node & subnodes have occurance 1: 1 or Unbounded.

It means that all the node & subnodes are mandatory, as minimum requirement is 1. Blank is not allowed in any node or subnode.

Also field has 1:1 occurance, it is also mandatory.

Check & pass the values in all the node & subnodes, also in fields have 1:1 occurance.

If you are not getting any value in source structure. Pass the constant value in the field.

Give IF condition, if Source Exists --> Pass Value.

Else --> Source Not Exists --> Pass Constant (SPACE).

Former Member
0 Kudos

Means,the error such as cannot creae target element can also occur?

A) No for that case u will not get this error. Ur error is because of missing root node mapping and occurance.

Check one by one root node mapping that is the best approach as u have many root node in ur structure.

Also U can use display queue function to verify the target output.

chirag

former_member200962
Active Contributor
0 Kudos
Means,the error such as cannot creae target element can also occur?

It will occur for a mandatory element if the condition required for its creation fails!