Custom Database Functoid

Home Page Forums BizTalk 2004 – BizTalk 2010 Custom Database Functoid

Viewing 3 reply threads
  • Author
    Posts
    • #16088

      Hi all,

      I would like to create a custom functoid for my mapping needs that would
      access a DB and return a DataTable (preferably) or at an Array of value. I
      would have another functoid that would consume that Database functoid (and
      the DataTable that it generates) and get a particular value out of it (based
      on some other node value or loop index for example).
      Those 2 functoids would work in concert, a bit like the "Table Looping" and
      "Table Extractor" functoids work together.

      Now in all the custom functoids example i see on the internet, functoids are
      always of the type
      public string DoSomething(string param1, string param2)
      they ALWAYS manipulate string and returns string.

      I have 2 questions:
      1. Is there a limitation in the Type a functoid can use in his signature? If
      yes, any reference to that?
      2. Is there anyone who has or know of an example of more complex functoids
      that use more complex datatypes? There is one in the Biztalk Samples
      (%instal_dir%/SDK\Samples\XmlTools\CustomFunctoid) that uses an array
      indirectly through a global variable but still all the functoids use only
      string type as parameter and return type. But I am not really interested in
      following that "global variable" road.

      Thanks in advance,

      Francois Malgreve

    • #16096

      Have you considered the Database Lookup and Value extractor functoids

      • #16114

        I cannot use the database functoid as I need to retrieve more than one row and more importantly I am executing a stored procedure that takes 5 parameters.

        Database lookup functoids accept only 1 parameter and direct access to a table.

        If you have any reference or information about complex custome functoid, I would be glad to know about it. All the examples i found so far are pretty simple and always string oriented. In the meantime i will continue to ressarch on my side.

        Francois Malgreve.

        • #17136

          Have you found "DBFunktoids"?


          http://blogs.msdn.com/ebattalio/archive/2006/02/16/DBFunktoids.aspx

          DBFunktoids – SQL Server Stored Procedure Functoid / Extractor Functoids

          DBFunktoids is a collection of three functoids that enable the invocation and manipulation of SQL Server 2000 / 2005 stored procedures and their results. You can find a zip with the project and a compiled assembly at the end of this article.

          DBFunktoids were written for BizTalk 2006 and the .NET Framework 2.0. If there is enough interest, I can port the project back to BizTalk 2004 (it should pretty much be code copy with a replacement of a Dictionary Generic with a Hashtable).

          DBFunktoids are described below.

    • #17143

      We wrote our own for this reason.

      Always consume and pass string is correct.

      We returned a delimited string as the db result and parsed it.  we are calling sprocs to get this string.

      As far as returning array I can't help you. Also I have no idea if the string length is limited.

      -weak architect

       

    • #17149

      Francois,

       This is just a quick pointer for you, if you choose to go this way and need more information let me know.

      I'm usually using custom xsl and not the mapper with links and functoids (but the two boil down to the same thing in the end so this is by no means a restriction)

       I was able to write a custom function in c# that both receives and returns XPathNodeIterator (which resides in System.Xml.XPath).

      Using this class you can pass xslt node sets in and out of the helper class, there are quite a few resources on the web on how to use these classes.

      You could then write a custom class to do your lookup and return a node set whcih you could then iterate on in your xsl (but it may mean you need to re-arrange your map/xsl)

      I hope this helps 

       

       

Viewing 3 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.