Você pode utilizar a subárvore Destino para configurar destinos de destino utilizados por nós de saída, pelo nó HTTPRequest e pelo nó RouteToLabel. Os exemplos abaixo mostram como criar e utilizar um procedimento ESQL para desempenhar a tarefa de configurar valores para cada uma destas utilizações.
Você pode copiar e utilizar estes procedimentos conforme mostrado, ou pode modificá-los ou estendê-los para desempenhar tarefas semelhantes.
CREATE PROCEDURE addToMQDestinationList(IN LocalEnvironment REFERENCE, IN newQueue char) BEGIN /******************************************************************************* * Um procedimento que incluirá um nome de fila na lisa de destino do MQ * no ambiente local. * Esta lista é utilizada por um nó MQOuput que tem seu modo configurado como Lista de Destino. * * EM Ambiente Local: Ambiente Local a ser modificado. * Configure isto como OutputLocalEnvironment quando chamar este procedimento * NA fila: fila a ser incluída na lista * *******************************************************************************/ 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;
CREATE PROCEDURE overrideDefaultHTTPRequestURL(IN LocalEnvironment REFERENCE, IN newUrl char) BEGIN /******************************************************************************* * Um procedimento que irá alterar a URL à qual o nó HTTPRequest enviará o pedido. * * EM Ambiente Local: Ambiente Local a ser modificado. * Configure isto como OutputLocalEnvironment quando chamar este procedimento * Fila IN: URL para a qual enviar o pedido. * *******************************************************************************/ set LocalEnvironment.Destination.HTTP.RequestURL = newUrl; END;
CREATE PROCEDURE addToRouteToLabelList(IN LocalEnvironment REFERENCE, IN newLabel char) BEGIN /******************************************************************************* * Um procedimento que incluirá um nome de etiqueta na lista RouteToLabel * no ambiente local. * Esta lista é utilizada por um nó RoteToLabel. * * EM Ambiente Local: Ambiente Local a ser modificado. * Configure isto como OutputLocalEnvironment quando chamar este procedimento * NA etiqueta: etiqueta a ser incluída na lista * *******************************************************************************/ 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;