locked
Call helper method in Map RRS feed

  • Question

  • I was wondering is it possible to to call helper method from MAP. I have Map where source schema gets data from oracle and it transforms it in require XML format. I want to update 2 date fileds in each records on run time. So i was wondering If I can create helper method to connect to SQL and get require dates and then if I could call this helper method from within Map.

    If this is not possible then, is there any othe way to do this?

    Thanks,

     

    Ashley


    Ashley
    Wednesday, October 13, 2010 6:42 AM

Answers

  • Hi Ashley,

    You can do this by using the Custom Script functoid and then calling the external assembly method from the functoid. Drag the custom script functoid then select choose assembly, then class and then the method in the class.

     You can see Scripting Functoid on MSDN.


    Abdul Rafay - MVP & MCTS BizTalk Server
    blog: http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps.
    • Marked as answer by ashfon Thursday, October 14, 2010 6:48 AM
    Wednesday, October 13, 2010 6:50 AM
  • Hi Ashley,

    Yes you can call helper method from inside BizTalk map either through Script Functoid (see for an example this post by Richard) or you could develop a custom functoid, where you could implement your logic (it is bit more work, but has more flexibility and can be reused).

    HTH

    Regards,

    Steef-Jan Wiggers - MVP & MCTS BizTalk Server
    blog: http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    • Marked as answer by ashfon Thursday, October 14, 2010 6:48 AM
    Wednesday, October 13, 2010 7:32 AM
    Moderator
  • Hi Ashley,

    Yes, you can call any external assembly method from BizTalk Map using Scripting Functoid. For details walkthrough you can visit the links provided by Steef and Abdul.

    One thing, I would like to mention here is that, If your requirement is just only to fetch data from SQL server, in that case you can use the builtin Database Lookup and Value Extractor functoid to serve your purpose.

    Have a look into below links:

    http://msdn.microsoft.com/en-us/library/aa547392(BTS.70).aspx

    http://www.c-sharpcorner.com/UploadFile/john_charles/BizTalkMappingUsingtheDatabaseLookupFunctoid04032009093932AM/BizTalkMappingUsingtheDatabaseLookupFunctoid.aspx

    Regards,

    Abhijit


    Abhijit Mahato - MCTS BizTalk Server blog: http://abhijitmahato.wordpress.com/ Please "Mark as Answer" if Post has Answered the Question
    • Marked as answer by ashfon Thursday, October 14, 2010 6:48 AM
    Wednesday, October 13, 2010 9:19 AM

All replies

  • Hi Ashley,

    You can do this by using the Custom Script functoid and then calling the external assembly method from the functoid. Drag the custom script functoid then select choose assembly, then class and then the method in the class.

     You can see Scripting Functoid on MSDN.


    Abdul Rafay - MVP & MCTS BizTalk Server
    blog: http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps.
    • Marked as answer by ashfon Thursday, October 14, 2010 6:48 AM
    Wednesday, October 13, 2010 6:50 AM
  • Hi Ashley,

    Yes you can call helper method from inside BizTalk map either through Script Functoid (see for an example this post by Richard) or you could develop a custom functoid, where you could implement your logic (it is bit more work, but has more flexibility and can be reused).

    HTH

    Regards,

    Steef-Jan Wiggers - MVP & MCTS BizTalk Server
    blog: http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    • Marked as answer by ashfon Thursday, October 14, 2010 6:48 AM
    Wednesday, October 13, 2010 7:32 AM
    Moderator
  • Hi Ashley,

    Yes, you can call any external assembly method from BizTalk Map using Scripting Functoid. For details walkthrough you can visit the links provided by Steef and Abdul.

    One thing, I would like to mention here is that, If your requirement is just only to fetch data from SQL server, in that case you can use the builtin Database Lookup and Value Extractor functoid to serve your purpose.

    Have a look into below links:

    http://msdn.microsoft.com/en-us/library/aa547392(BTS.70).aspx

    http://www.c-sharpcorner.com/UploadFile/john_charles/BizTalkMappingUsingtheDatabaseLookupFunctoid04032009093932AM/BizTalkMappingUsingtheDatabaseLookupFunctoid.aspx

    Regards,

    Abhijit


    Abhijit Mahato - MCTS BizTalk Server blog: http://abhijitmahato.wordpress.com/ Please "Mark as Answer" if Post has Answered the Question
    • Marked as answer by ashfon Thursday, October 14, 2010 6:48 AM
    Wednesday, October 13, 2010 9:19 AM
  • Hi,

    You can use scripting functoid call an external assembly.  Please see sample at http://denzilpinto.spaces.live.com/blog/cns!A2256C53CD2EC18E!193.entry?sa=745384511.

    Regards,

    Tariq Majeed


    Please mark it as answer if it helps
    Wednesday, October 13, 2010 11:49 AM
  • I am comming a bit late, but just implemented a solution using this.

    We had a transcodification table in Oracle Database, so what I did is, use an external assembly and load the Oracle Table in cache using Enterprise Library (Caching stuff).

    The idea was that I wanted for performance reasons connect only once and load the data.

    What I learned is :

    You cannot use static methods in your C# class (they are not thread safe)

    You cannot use singleton, you need a wrapper class.

    Be careful on performance issues

    Regards,

    Stefan

    BizTalk Consultant

     

     

    Wednesday, October 13, 2010 3:37 PM
  • Thanks Guys for all replies. Each of this solution works :). But Yes Stefan is right we have to aware of performance issue. Our external assemble has to be trade safe.

    Regards,


    Ashley


    Ashley
    Thursday, October 14, 2010 6:57 AM