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 field | Description |
|---|---|
| Script Type | Use this field to select the type of script you want to use in this Scripting functoid.
Values:
|
| Script Assembly | Select 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 Class | Select 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 Method | Select the method within the chosen class that you want this Scripting functoid to use.
|
| Inline Script Buffer | Write 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.

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

This section contains:
- Scripting Using External Assemblies
- Scripting Using Inline C#, JScript .NET, and Visual Basic .NET
- Scripting Using Inline XSLT and XSLT Call Templates
All rights reserved.