実行時の .NETInput ノード・プロパティーへのアクセス

.NETInput ノードをメッセージ・フローに追加すると、ノードの「ユーザー定義プロパティー」タブを使用して、実行時に入力ノードのロジックを実装する .NET コネクター・コードによってアクセス可能なプロパティーを指定できます。

.NET フレームワークは、キーとそれに関連する値の集合を表す、Dictionary<TKey, TValue> という名前空間 System.Collections.Generic 内のクラスを提供します。.NETInput ノードのコードの作成時に、EventInputConnector または PollingInputConnector クラスの新規インスタンスを初期化する場合は、Microsoft Visual Studio で提供されるテンプレートが役立ちます。テンプレート・コードには、データ・タイプが Dictionary<string,string> である properties パラメーターを含む、EventInputConnector または PollingInputConnector クラスのサブクラスの定義が含まれています。 このパラメーターには、ノードのユーザー定義プロパティーと、フロー・レベルのユーザー定義プロパティーが含まれています。

個々のプロパティー名では大/小文字が区別されます。例えば、.NETInput ノードの Property1 という「ユーザー定義プロパティー」とは別のものになる、property1 というフロー・レベルのユーザー定義プロパティーを定義することができます。名前および大/小文字が同じであるフロー・レベルのユーザー定義プロパティーと .NETInput ノードのユーザー定義プロパティーを指定した場合は、.NETInput ノードのプロパティーが優先されます。

以下のコード・スニペットは単純な例を示しています。

public PollingInputConnector(NBConnectorFactory connectorFactory, string name, Dictionary<string, string> properties) : base(connectorFactory, name, properties)
{
// Check the Dictionary of user defined properties defined on the node.
// If there is a property named queueName then take its value for use later:
if (properties.ContainsKey("queueName"))      
{
queueName = properties["queueName"];
}
}
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック

Copyright IBM Corporation 1999, 2013Copyright IBM Corporation 1999, 2013.

        
        最終更新:
        
        最終更新: 2013-07-17 15:20:31


タスク・トピックタスク・トピック | IBM Integration Bus バージョン 9.0.0.0 | bc34233_