カスタム参照のファンクトイドは、実装コードをマップにインラインでコピーしません。 代わりに、アセンブリ、クラス、メソッドへの参照が、生成されたスタイル シートに関連付けられた拡張オブジェクト ファイルに配置され、実行時に呼び出されます。
例
次の例は、2 つの文字列を連結するためのカスタム参照 Functoid を作成する方法を示しています。 これは、3 つの文字列リソースと 16 x 16 ピクセルのビットマップ リソースを含むリソース ファイルに依存します。
using System;
using Microsoft.BizTalk.BaseFunctoids;
using System.Reflection;
namespace Microsoft.Samples.BizTalk.CustomFunctoid
{
/// <summary>
/// Performs a string concatenation through assembly referenced function. Assembly must be deployed with the BizTalk solution.
/// </summary>
public class CustomStringConcatFunctoid : BaseFunctoid
{
public CustomStringConcatFunctoid()
: base()
{
//ID for this functoid
this.ID = 6001;
// Resource assembly must be ProjectName.ResourceName if building with VS.Net
SetupResourceAssembly("Microsoft.Samples.BizTalk.CustomFunctoid.CustomFunctoidResources", Assembly.GetExecutingAssembly());
// Pass the resource ID names for functoid name, tooltip
// description and the 16x16 bitmap for the Map palette
SetName("IDS_CUSTOMSTRINGCONCATFUNCTOID_NAME");
SetTooltip("IDS_CUSTOMSTRINGCONCATFUNCTOID_TOOLTIP");
SetDescription("IDS_CUSTOMSTRINGCONCATFUNCTOID_DESCRIPTION");
SetBitmap("IDB_CUSTOMSTRINGCONCATFUNCTOID_BITMAP");
// Put this string handling function under the String
// Functoid tab in the Visual Studio toolbox for functoids
this.Category = FunctoidCategory.String;
// 2 required parameters, no optional parameters
this.SetMinParams(2);
this.SetMaxParams(2);
// Functoid accepts two inputs
AddInputConnectionType(ConnectionType.AllExceptRecord);
AddInputConnectionType(ConnectionType.AllExceptRecord);
// Set the output connection type
this.OutputConnectionType = ConnectionType.AllExceptRecord;
// Set the function name that needs to be called
// when this functoid is invoked. The resulting assembly
// must be present in the Global Assembly Cache
// to ensure its availability.
SetExternalFunctionName(GetType().Assembly.FullName, "Microsoft.Samples.BizTalk.CustomFunctoid.CustomStringConcatFunctoid", "ConCatStrings");
}
// This function is executed by BizTalk to do the concatenation
public string ConCatStrings(string val1, string val2)
{
return val2 + val1;
}
}
}
こちらもご覧ください
BaseFunctoid の使用
カスタムインライン関数体の開発
カスタム累積ファンクトイドの開発
カスタムファンクトイド (BizTalk Server サンプル)