Export (0) Print
Expand All

Scripting Functoid

The Scripting functoid enables you to use custom script or code at run time to perform functions otherwise not available. For example, you can call a .NET assembly at run time by using the Scripting functoid and writing your own custom functions.

The Scripting functoid in Microsoft® BizTalk® Server 2004 extends the number of supported languages from previous versions of BizTalk. Microsoft® BizTalk® Server 2004 supports the following languages for the Scripting functoid:

  • C# .NET
  • JScript .NET
  • Visual Basic .NET
  • Extensible Stylesheet Language Transformations (XSLT)
  • XSLT Call Templates

    Important  Any code written in an external assembly for use in a scripting functoid needs to be thread safe. This is required because multiple instances of a map can use these .NET instances at run time under stress conditions.

Another significant difference between the current Scripting functoid and earlier versions is that the script need no longer be created and stored in the functoid itself. Instead, you can create the script in a separate .NET assembly and reference the assembly through the Script property. Having the script in a separate assembly enables you to use the same script in more than one map. Additionally, you may be able to purchase Scripting functoid assemblies from third-party vendors.

You can use Scripting functoids created in previous versions of BizTalk Mapper with the current version of BizTalk Mapper. However, you must migrate the functoids first. For more information about how to migrate Scripting functoids, see Migrating Functoids.

When you add a Scripting functoid to a map, you need to configure the script the functoid uses. If you select a Scripting functoid, the Script property is enabled in the Properties window. If you click the ellipsis (...) button for this property, the Configure Functoid Script dialog box opens.

The following table shows the fields of this dialog box.

Configure Functoid Script dialog box fieldDescription
Script TypeUse this field to select the type of script you want to use in this Scripting functoid.

Values:

  • External Assembly. Use this value if you want to associate this Scripting functoid with an assembly in the global assembly cache (GAC).
  • Inline C#. Use this value if you want to associate this Scripting functoid with C# code in the Inline Script Buffer property.
  • Inline JScript .NET. Use this value if you want to associate this Scripting functoid with JScript .NET script in the Inline Script Buffer property.
  • Inline Visual Basic .NET. Use this value if you want to associate this Scripting functoid with Visual Basic .NET code in the Inline Script Buffer property.
  • Inline XSLT. Use this value if you want to associate this Scripting functoid with XSLT in the Inline Script Buffer property.
  • Inline XSLT Call Template. Use this value if you want to associate this Scripting functoid with XSLT call templates in the Inline Script Buffer property.
Script AssemblySelect the assembly to associate with this Scripting functoid. Only assemblies referenced in the Project window appear in this list. Note also that you must register assemblies in the GAC.

This field is only available when Script Type is set to External Assembly.

Script ClassSelect the class within the chosen assembly that you want this Scripting functoid to use.

This field is only available when Script Type is set to External Assembly.

Script MethodSelect the method within the chosen class that you want this Scripting functoid to use.

Note  Make sure the number of input parameters expected by the method matches the number of input parameters specified in the Configure Functoid Inputs dialog box.

Inline Script BufferWrite or copy the inline script to be used into this text box. Valid languages and scripts include: C#, JScript .NET, Visual Basic .NET, XSLT, and XSLT call templates.

This field is only available when Script Type is set to one of the Inline settings.

The following figure shows the dialog box with Inline C# selected and code entered in the buffer.

Configure Functoid Script Dialog

The following figure shows how the Scripting functoid appears in a map using the C# .Net script to reformat a telephone number.

Scripting Functoid Map

This section contains:

To download updated BizTalk Server 2004 Help from www.microsoft.com, go to http://go.microsoft.com/fwlink/?linkid=20616.

Copyright © 2004 Microsoft Corporation.
All rights reserved.
Show:
© 2014 Microsoft