.NETCompute ノードからのユーザー定義プロパティーへのアクセス

.NETCompute ノードをカスタマイズして、そのノードが含まれるメッセージ・フローと関連付けたプロパティーにアクセスすることができます。

.NETCompute ノードからこれらのプロパティーにアクセスするには、GetUserDefinedProperty または GetUserDefinedPropertyAsString メソッドを使用します。 以下のサンプル C# コードは、メソッドの使用方法を示しています。
                #region UserCode
                // Add user code in this region to create a new output message
                int intProperty = (int)this.GetUserDefinedProperty("intProperty");
                string stringProperty = this.GetUserDefinedPropertyAsString("stringProperty");
                NBElement msg = outputRoot.CreateLastChildUsingNewParser(NBParsers.XMLNSC.ParserName).CreateFirstChild(null, "Message");               
                NBElement el2 = msg.CreateFirstChild("Element2");
                NBElement el1 = msg.CreateFirstChild("Element1");
                el1.SetValue("The message flow user defined property named intProperty has the value "+intProperty.ToString());
                el2.SetValue("The message flow user defined property named stringProperty has the value "+stringProperty);
                #endregion UserCode
このコードは、次のメッセージを生成します (整数およびストリング・フロー・プロパティーはそれぞれ、23、"Hello World!" に設定されます)。
<メッセージ> <Element1>The message flow user defined property named intProperty has the value 23</Element1>
 <Element2>The message flow user defined property named stringProperty has the value Hello World!</Element2>
</Message>
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック

Copyright IBM Corporation 1999, 2012Copyright IBM Corporation 1999, 2012.

        
最終更新

        最終更新 : 2012-07-13 15:45:10


タスク・トピックタスク・トピック | バージョン 8.0.0.1 | bc34220_