填充 LocalEnvironment 树中的 Destination

您可以使用 Destination 子树来设置输出节点使用的目标位置。下面的示例显示了如何能创建和使用 ESQL 过程来执行针对每次使用设置值的任务。

如下所示,您可以复制并使用这些过程,或者可以修改或扩展这些过程来执行类似的任务。

添加 MQOutput 节点的队列名称。
更新开始
CREATE PROCEDURE addToMQDestinationList(IN LocalEnvironment REFERENCE, IN newQueue char) BEGIN
/*******************************************************************************
* A procedure that will add a queue name to the MQ destination list
* in the local environment.
* This list is used by a MQOuput node which has its mode set to Destination list.
*
* IN LocalEnvironment: LocalEnvironment to be modified.
* Set this to OutputLocalEnvironment when calling this procedure
* IN queue: queue to be added to the list
*
*******************************************************************************/
DECLARE I INTEGER CARDINALITY(LocalEnvironment.Destination.MQDestinationList.DestinationData[]);
IF I = 0 THEN
SET LocalEnvironment.Destination.MQDestinationList.DestinationData[1].queueName = newQueue;
         ELSE
SET LocalEnvironment.Destination.MQDestinationList.DestinationData[I+1].queueName = newQueue;
END IF;
  END;
更新结束
更改用于 HTTPRequest 节点请求的缺省 URL。
CREATE PROCEDURE overrideDefaultHTTPRequestURL(IN LocalEnvironment REFERENCE, IN newUrl char) BEGIN
/*******************************************************************************
* A procedure that will change the URL to which the HTTPRequest node will send the request.
*
* IN LocalEnvironment: LocalEnvironment to be modified.
* Set this to OutputLocalEnvironment when calling this procedure
* IN queue: URL to send the request to.
*
*******************************************************************************/
set LocalEnvironment.Destination.HTTP.RequestURL = newUrl;
  END;
为 RouteToLabel 节点添加标注。
CREATE PROCEDURE addToRouteToLabelList(IN LocalEnvironment REFERENCE, IN newLabel char) BEGIN
/*******************************************************************************
* A procedure that will add a label name to the RouteToLabel list
* in the local environment.
* This list is used by a RoteToLabel node.
*
* IN LocalEnvironment: LocalEnvironment to be modified.
* Set this to OutputLocalEnvironment when calling this procedure
* IN label: label to be added to the list
*
*******************************************************************************/
if LocalEnvironment.Destination.RouterList.DestinationData is null then
set LocalEnvironment.Destination.RouterList.DestinationData."label" = newLabel;
else
create LASTCHILD OF LocalEnvironment.Destination.RouterList.DestinationData
NAME 'label' VALUE newLabel;
end if;
  END;
相关概念
消息流概述
LocalEnvironment 树
相关参考
Compute 节点
DestinationData 子树中元素的数据类型
CREATE PROCEDURE 语句
SET 语句
声明 | 商标 | 下载 | | 支持 | 反馈
Copyright IBM Corporation 1999, 2006 最后更新:2006/05/19
ac16862_