.NETCompute ノードによるグローバル環境の更新

.NETCompute ノードを使用することにより、グローバル環境を変更します。

論理ツリーが入力メッセージ用に作成される際に、Global Environment ツリーが必ず作成されます。 しかし、メッセージ・フローは、そこにデータを取り込んだり、その内容を使用したりすることはありません。 このツリーは、あるノードから別のノードへと情報を受け渡すなどの、独自の目的に使用できます。 このツリー全体をスクラッチパッドまたは作業域として使用できます。
グローバル環境はメッセージ・フローのどこででも変更できます。したがって、変更の際にグローバル環境のコピーを作成しません。 以下の C# コードは、.NETCompute ノードでグローバル環境を変更する方法を示しています。
        public override void Evaluate(NBMessageAssembly inputAssembly)
        {
            NBOutputTerminal outTerminal = OutputTerminal("Out");
            NBMessage inputMessage = inputAssembly.Message;
            // Create a new empty message, ensuring it is disposed after use
            using (NBMessage outputMessage = new NBMessage())
            {
                NBMessageAssembly outAssembly = new NBMessageAssembly(inputAssembly, outputMessage);
                NBElement inputRoot = inputMessage.RootElement;
                NBElement outputRoot = outputMessage.RootElement;

                // Optionally copy message headers, remove if not needed
                CopyMessageHeaders(inputRoot, outputRoot);

                #region UserCode
                // Add user code in this region to create a new output message
                NBMessage env = outAssembly.Environment;
                env.RootElement.CreateFirstChild(null, "Status", "Success");                               
                #endregion UserCode

                // Change the following if not propagating message to the 'Out' terminal
                outTerminal.Propagate(outAssembly);
            }
        }
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック

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

        
最終更新

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


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