Mapper main function

This is the main entry point for the mapper. This function initializes the mapper, the output message, and some references before calling ProcessTransaction().

CREATE FUNCTION Main() RETURNS BOOLEAN
MAPPER: BEGIN

   -----------------------------
   -- Mapper Initialization Code
   -----------------------------
   IF NOT PSEUDO_CONST_INIT THEN
      CALL InitPseudoConstants();
   END IF;

   CALL CopyEntireMessage();

   -- Initialize the reference rOutputBody
   CREATE LASTCHILD OF OutputRoot AS rOutputTxn DOMAIN OUTPUT_DOMAIN;

   -- point to ISFMessage
   MOVE rIsf TO rInputTxn.{INPUT_DOMAIN}; 

   -- TODO BEGIN
   -- You can comment this out as a minor optimization if using MRM
   IF EXISTS(rIsf.{isf}:ISFMessage[]) THEN
      MOVE rIsf TO rIsf.{isf}:ISFMessage; -- required if using XMLNSC
   END IF;
   -- TODO END

   CALL ProcessTransaction();

   RETURN TRUE;
END MAPPER;