BizTalk Server General - Functoids

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > April 2004 > Functoids





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 Functoids
Guru

2004-04-24, 7:34 am

All

I understand from MSDN documentation that functoids can be used in a mapper when we have a well defined destination schema.

I have a situation like this. I would get repeated number of times a record or node in my XML schema.
The corresponding node in my destination schema has to occur only once but with all the values . Say for
example, I have a node called Name in source schmea which is appearing 10 times. My requirement is that
I need to have only one NAME node in my destination schema but with all the 10 values separated by a SPACE.

Also if any of the value is NULL, then I need to do a DB lookup and fetch default name and add it to my
destination schema.

I know I can use of index functoids, but this may not be useful in above scenario. Am I right?

I think only scripting functoid is useful here. Any suggestions pls

Thanks
Matt Milner

2004-04-24, 10:35 pm

Take a look at the custom functoid sample in the updated SDK. The
"cumulative multiply" sample shows how you can do a cumulative functoid to
build up your output.

you might be able to do some other things with conditional functoids and the
db lookup functoid but I can't picture it in my head.

matt


"Guru" <anonymous@discussions.microsoft.com> wrote in message
news:BC1D1A7B-806B-4F99-962F-7D7AAAEFED69@microsoft.com...
> All
>
> I understand from MSDN documentation that functoids can be used in a

mapper when we have a well defined destination schema.
>
> I have a situation like this. I would get repeated number of times a

record or node in my XML schema.
> The corresponding node in my destination schema has to occur only once but

with all the values . Say for
> example, I have a node called Name in source schmea which is appearing 10

times. My requirement is that
> I need to have only one NAME node in my destination schema but with all

the 10 values separated by a SPACE.
>
> Also if any of the value is NULL, then I need to do a DB lookup and fetch

default name and add it to my
> destination schema.
>
> I know I can use of index functoids, but this may not be useful in above

scenario. Am I right?
>
> I think only scripting functoid is useful here. Any suggestions pls
>
> Thanks



Guru

2004-04-25, 2:34 am

Hi Matt

Thanks for your inputs.

But how will I run the sameple. I am able to follow till adding it as a custom functoid in the mapper toolbox. AFter that how would I use the same to get the result and see it.

Well I have one more question.

As I said in my post, suppose if I have 10 nodes on my souce schema say Name node coming as 10 times, how to make all the 10 Name noded appearing on the destination schema. For example

Source Schmea Destination Schema

<Name>Guru1</Name> Name[0].value = Guru
<Name>Sample1</Name> Name[1].value = Sample1
<Name>Sample2</Name> Name[2].value = Sample2

The above example shows that depending on number of Name nodes in my source schme, that many number of Name nodes with index have to be created in my destination schema.

1) First of all how will I create such a destination schemain BTS 2004? Utmost I can make Name node to appear as unbound. But how will I add index as shown above in my destination schema?

Guru

2004-04-25, 3:35 am

Matt

How will I distribute my Custom Functoids when I deploy my project or solution at my client's location?

Guru

2004-04-25, 6:34 am

Matt

I think the cumlative multiple custom functoid would retun a single output, which I do not want.
I need all the values but under a single tag separated by a SPACE.

Thanks in advance
Matt Milner

2004-04-25, 9:36 pm

Sorry, I thought you were trying to put all the names into one output.

Not sure how you are going to define your destination schema so that you can
have those nodes, unless you use some "xmlany elements", then you'll be able
to add the nodes you want. You could probably just use the scripting
functoid and do some simple XSLT that uses the index to output the element
you want.

In terms of deployment if your functoid exposes code that is not inline,
then you will need to deploy it into the GAC, otherwise, I believe
everything that is needed is included in the map so unless you need design
time experience, you wouldn't need to deploy it to the server, just
developer machines.


Matt



"Guru" <anonymous@discussions.microsoft.com> wrote in message
news:D2C79331-C66B-426E-BA9B-6B4992B0D70F@microsoft.com...
> Hi Matt
>
> Thanks for your inputs.
>
> But how will I run the sameple. I am able to follow till adding it as a

custom functoid in the mapper toolbox. AFter that how would I use the same
to get the result and see it.
>
> Well I have one more question.
>
> As I said in my post, suppose if I have 10 nodes on my souce schema say

Name node coming as 10 times, how to make all the 10 Name noded appearing on
the destination schema. For example
>
> Source Schmea Destination Schema
>
> <Name>Guru1</Name> Name[0].value = Guru
> <Name>Sample1</Name> Name[1].value = Sample1
> <Name>Sample2</Name> Name[2].value = Sample2
>
> The above example shows that depending on number of Name nodes in my

source schme, that many number of Name nodes with index have to be created
in my destination schema.
>
> 1) First of all how will I create such a destination schemain BTS 2004?

Utmost I can make Name node to appear as unbound. But how will I add index
as shown above in my destination schema?
>



Guru

2004-04-26, 8:35 am

Matt

Thanks for your response.
As you said, I need the output in both the formats. Depending on a condition, I need to have my destination containing elements as a single output and also as a separate as shown in the example.

Is it best to go for a scripting functoid to achieve this?

Matt, is it possible to write a generic scripting functoid, to which I will pass a condition, depending on which it has to select the correct destination schema and convert that into a flat file?

Otherwise I need to write a script for each condition. Am I right?

Thanks in advance
Matt Milner

2004-04-26, 11:35 pm

I'd say you CAN write a funcoid scripting component that would do this type
of work, but you'd need to have specified your message schema to support it.
you don't need to create a flat file in a map, you just need to map schema
to schema. When the file is serialized out biztalk will handle converting
it from XML to a flat file (you might need to use the flat file assembler
for this to happen).

It sounds like you could easily use a decide shape in your orchestration and
then on each branch put a different map to get the output you want and send
it out. Maybe I am missing the high points of your situation.

matt


"Guru" <anonymous@discussions.microsoft.com> wrote in message
news:66D5091C-9B77-45B6-8F05-FCC5E62286AF@microsoft.com...
> Matt
>
> Thanks for your response.
> As you said, I need the output in both the formats. Depending on a

condition, I need to have my destination containing elements as a single
output and also as a separate as shown in the example.
>
> Is it best to go for a scripting functoid to achieve this?
>
> Matt, is it possible to write a generic scripting functoid, to which I

will pass a condition, depending on which it has to select the correct
destination schema and convert that into a flat file?
>
> Otherwise I need to write a script for each condition. Am I right?
>
> Thanks in advance



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com