BizTalk Server - BizTalk Mapper BUG ?

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server > July 2005 > BizTalk Mapper BUG ?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author BizTalk Mapper BUG ?
Luis Azedo

2005-07-13, 2:47 am

Hi All,

i'm having the following problem with mapper.

my destination schema has some optional attributes with default values on
some elements. these elements have minoccurs=0, but they keep apearing on my
output result (attributes with default values) when i don't have any links to
them. if i remove the default values from the attributes everything is well.


Yossi Dahan

2005-07-13, 6:00 pm

Luis

I believe this is the purpose of the default value property - to make sure a
field is being created and populated with the value specified.

What behaviour did you expect?

Yossi Dahan


"Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
news:560C7ACE-5CB4-4100-B261-11FDE85851FE@microsoft.com...
> Hi All,
>
> i'm having the following problem with mapper.
>
> my destination schema has some optional attributes with default values on
> some elements. these elements have minoccurs=0, but they keep apearing on
> my
> output result (attributes with default values) when i don't have any links
> to
> them. if i remove the default values from the attributes everything is
> well.
>
>



Luis Azedo

2005-07-13, 6:00 pm

Hi Yossi, thanks for the reply.

what i would expect is that the mapper would make sure that the field is
populated, but if the parent node isn't created because i didn't make any to
it, and its minOccurs value = 0, then default value should be ignored.

let me try to explain with an example

Source

<a>
<b>xxxxxxx</b>
<c>
<c1>wwwwwww</c1>
</c>
</a>

Destination

<x>
<y>xxxxxxx<y/>
<z>wwwwwww</z>
<w myatribute="defaultvalue"></w>
</x>

since i didn't make a link between any field/record from source to element
<w> in destination, and since element <w> as minocccurs = 0, then element w
shouldn't appear in the output.

the rule should be something like : ensure that the destination
fields/records appear if they have a default value and is parent node is
populated by a link or it also has a default value.


does this make any sense ?

TIA





"Yossi Dahan" wrote:

> Luis
>
> I believe this is the purpose of the default value property - to make sure a
> field is being created and populated with the value specified.
>
> What behaviour did you expect?
>
> Yossi Dahan
>
>
> "Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
> news:560C7ACE-5CB4-4100-B261-11FDE85851FE@microsoft.com...
>
>
>

Yossi Dahan

2005-07-13, 6:00 pm

I understand what you're tying to do now, but I'm afraid I still don't think
you can achieve this simply be specifying a default value.
Specifying a default value is essentially like linking the attribute - you
instruct the map to write a value and it is kindly doing what you've asked
for.

You will have to have a bit more complex mapping, checking the existence of
the source element and using the result of this check with a value mapping
functoid to link a constant value (assuming, from your choice of using a
default value that this is in fact a constant) to the attribute

Good luck

Yossi Dahan


"Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
news:118685E1-15BD-4377-BB49-E8C00F83C0FC@microsoft.com...[vbcol=seagreen]
> Hi Yossi, thanks for the reply.
>
> what i would expect is that the mapper would make sure that the field is
> populated, but if the parent node isn't created because i didn't make any
> to
> it, and its minOccurs value = 0, then default value should be ignored.
>
> let me try to explain with an example
>
> Source
>
> <a>
> <b>xxxxxxx</b>
> <c>
> <c1>wwwwwww</c1>
> </c>
> </a>
>
> Destination
>
> <x>
> <y>xxxxxxx<y/>
> <z>wwwwwww</z>
> <w myatribute="defaultvalue"></w>
> </x>
>
> since i didn't make a link between any field/record from source to element
> <w> in destination, and since element <w> as minocccurs = 0, then element
> w
> shouldn't appear in the output.
>
> the rule should be something like : ensure that the destination
> fields/records appear if they have a default value and is parent node is
> populated by a link or it also has a default value.
>
>
> does this make any sense ?
>
> TIA
>
>
>
>
>
> "Yossi Dahan" wrote:
>


Luis Azedo

2005-07-13, 6:00 pm

Thanks for the reply.

i know i can't achieve this the easy way, but shouldn't i ? as i see it, the
mapper component is doing lazy work "if there's a default value then write
its node tree to the output regardless his parent is optional with no default
value".i believe the mapper component is trying to simplify the actual xslt,
but in this case, is not doing a good job, in fact i think it's quite a BUG,
or am i missing something obvious ?

i had to remove the default value from the attribute to get right results,
but since i'm working with an imported schema from a partner, is this the
right way to do things ?

i tried other ways as you suggested (check existence, value mapping, etc )
but the outcome is always the same, i get the undeseried output.

TIA


"Yossi Dahan" wrote:

> I understand what you're tying to do now, but I'm afraid I still don't think
> you can achieve this simply be specifying a default value.
> Specifying a default value is essentially like linking the attribute - you
> instruct the map to write a value and it is kindly doing what you've asked
> for.
>
> You will have to have a bit more complex mapping, checking the existence of
> the source element and using the result of this check with a value mapping
> functoid to link a constant value (assuming, from your choice of using a
> default value that this is in fact a constant) to the attribute
>
> Good luck
>
> Yossi Dahan
>
>
> "Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
> news:118685E1-15BD-4377-BB49-E8C00F83C0FC@microsoft.com...
>
>
>

Yossi Dahan

2005-07-14, 7:47 am

I don't know Luis, I guess it is open to interpretation, as I said -in my
opinion setting a default value in the mapper is just like creating a link,
which instructs the mapper to write a value, could have been nice to have
the flexibility you're describing, but I wouldn't say it's a bug.

Good luck anyway

Yossi Dahan
"Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
news:C651F132-A2E9-41C5-AD6B-9295DEB76750@microsoft.com...[vbcol=seagreen]
> Thanks for the reply.
>
> i know i can't achieve this the easy way, but shouldn't i ? as i see it,
> the
> mapper component is doing lazy work "if there's a default value then write
> its node tree to the output regardless his parent is optional with no
> default
> value".i believe the mapper component is trying to simplify the actual
> xslt,
> but in this case, is not doing a good job, in fact i think it's quite a
> BUG,
> or am i missing something obvious ?
>
> i had to remove the default value from the attribute to get right results,
> but since i'm working with an imported schema from a partner, is this the
> right way to do things ?
>
> i tried other ways as you suggested (check existence, value mapping, etc )
> but the outcome is always the same, i get the undeseried output.
>
> TIA
>
>
> "Yossi Dahan" wrote:
>


Luis Azedo

2005-07-14, 7:47 am


sorry, maybe i was a litle confusing.

i absolutely agree with you, "setting a default value in the mapper should
create the link".

the question is about default values in the destination schema not the mapper.


"Yossi Dahan" wrote:

> I don't know Luis, I guess it is open to interpretation, as I said -in my
> opinion setting a default value in the mapper is just like creating a link,
> which instructs the mapper to write a value, could have been nice to have
> the flexibility you're describing, but I wouldn't say it's a bug.
>
> Good luck anyway
>
> Yossi Dahan
> "Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
> news:C651F132-A2E9-41C5-AD6B-9295DEB76750@microsoft.com...
>
>
>

Gerrit Hulleman

2005-07-14, 5:51 pm

Reading the thread... I know how. using BTS 2002 that is. Cannot give you an
example now, have no biztalk mapper available (am at home).

Link the parent record to a boolean functiod that returns true if there is a
linked record / field with content. Or link the source-record to the target
record (it may complain when linking, but it will not give any compilation
errors). Boolean functiod is the only functiod (as far as I know) that works
of the functiod solution. A custom function that returns true will not work.
You may have to allow linking to records in the options of the mapper, if
you have not done so allready.

Respond with a request if you want an example for bts2002.


Gerrit Hulleman


"Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
news:560C7ACE-5CB4-4100-B261-11FDE85851FE@microsoft.com...
> Hi All,
>
> i'm having the following problem with mapper.
>
> my destination schema has some optional attributes with default values on
> some elements. these elements have minoccurs=0, but they keep apearing on

my
> output result (attributes with default values) when i don't have any links

to
> them. if i remove the default values from the attributes everything is

well.
>
>



Luis Azedo

2005-07-14, 5:51 pm

Hi Gerrit and Thanks for the reply.

i often use that solution, but in this case my destination is rather complex
and very big.

what i was seeking is somekind of feedback from BTS team in order to have
this corrected in future SP or BTS2006. in many situations you don't control
the schema since its a partner schema, why does BTS Mapper rely on default
values in the destination schema rather than on default values we actually
put on the mapper ?

Thanks


"Gerrit Hulleman" wrote:

> Reading the thread... I know how. using BTS 2002 that is. Cannot give you an
> example now, have no biztalk mapper available (am at home).
>
> Link the parent record to a boolean functiod that returns true if there is a
> linked record / field with content. Or link the source-record to the target
> record (it may complain when linking, but it will not give any compilation
> errors). Boolean functiod is the only functiod (as far as I know) that works
> of the functiod solution. A custom function that returns true will not work.
> You may have to allow linking to records in the options of the mapper, if
> you have not done so allready.
>
> Respond with a request if you want an example for bts2002.
>
>
> Gerrit Hulleman
>
>
> "Luis Azedo" <LuisAzedo@discussions.microsoft.com> wrote in message
> news:560C7ACE-5CB4-4100-B261-11FDE85851FE@microsoft.com...
> my
> to
> well.
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com