LocalEnvironment 트리에서 Destination 트리 채우기

Destination 서브트리를 사용하여 출력 노드, HTTPRequest 노드 및 RouteToLabel 노드에서 사용하는 대상 목적지를 설정할 수 있습니다. 아래의 예는 사용 시마다 값을 설정하는 작업을 수행하기 위해 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;
관련 개념
메시지 플로우 개요
로컬 환경 트리 구조
관련 참조
Compute 노드
DestinationData 서브트리에서 요소의 데이터 유형
CREATE PROCEDURE문
SET문
주의사항 | 등록상표 | 다운로드 | 라이브러리 | 지원 | 피드백
Copyright IBM Corporation 1999, 2006 마지막 갱신 날짜: 2006/08/21
ac16862_