---------------------------------------------------------------------------------------------
-- HB_Replicat.inc
-- Description - Include heartbeat tables in any Replicat process, 
--               including performance monitoring tokens
---------------------------------------------------------------------------------------------
MAP GGADMIN.GGS_HEARTBEAT, TARGET GGADMIN.GGS_HEARTBEAT;
MAP GGADMIN.HEARTBEAT,     TARGET GGADMIN.GGS_HEARTBEAT,
  KEYCOLS (SRC_DB,EXTRACT_NAME),
  INSERTMISSINGUPDATES,
  COLMAP (USEDEFAULTS,
          ID = 0,
          SOURCE_COMMIT  = @DATE ("YYYY-MM-DD HH:MI:SS.FFFFFF","JTSLCT", @DATE ("JTS","YYYY-MM-DD HH:MI:SS.FFFFFF", @GETENV ("GGHEADER", "COMMITTIMESTAMP"))),
          EXTRACT_NAME   = @TOKEN ("CAPGROUP"),
          CAPTIME        = @TOKEN ("CAPTIME"),
          PMPGROUP       = @TOKEN ("PMPGROUP"),
          PMPTIME        = @TOKEN ("PMPTIME"),
          DELGROUP       = @GETENV ("GGENVIRONMENT", "GROUPNAME"),
          DELTIME        = @DATE ("YYYY-MM-DD HH:MI:SS.FFFFFF","JTSLCT",@GETENV ("JULIANTIMESTAMP")),
          EDDLDELTASTATS = @TOKEN ("EDDLDELTASTATS"),
          EDMLDELTASTATS = @TOKEN ("EDMLDELTASTATS"),
          RDDLDELTASTATS = @GETENV ("DELTASTATS", "DDL"),
          RDMLDELTASTATS = @GETENV ("DELTASTATS", "DML")
         );
MAP GGADMIN.HEARTBEAT,     TARGET GGADMIN.GGS_HEARTBEAT_HISTORY,
  KEYCOLS (ID),
  INSERTALLRECORDS,
  COLMAP (USEDEFAULTS,
          ID = 0,
          SOURCE_COMMIT  = @DATE ("YYYY-MM-DD HH:MI:SS.FFFFFF","JTSLCT", @DATE ("JTS","YYYY-MM-DD HH:MI:SS.FFFFFF", @GETENV ("GGHEADER", "COMMITTIMESTAMP"))),
          EXTRACT_NAME   = @TOKEN ("CAPGROUP"),
          CAPTIME        = @TOKEN ("CAPTIME"),
          PMPGROUP       = @TOKEN ("PMPGROUP"),
          PMPTIME        = @TOKEN ("PMPTIME"),
          DELGROUP       = @GETENV ("GGENVIRONMENT", "GROUPNAME"),
          DELTIME        = @DATE ("YYYY-MM-DD HH:MI:SS.FFFFFF","JTSLCT",@GETENV ("JULIANTIMESTAMP")),
          EDDLDELTASTATS = @TOKEN ("EDDLDELTASTATS"),
          EDMLDELTASTATS = @TOKEN ("EDMLDELTASTATS"),
          RDDLDELTASTATS = @GETENV ("DELTASTATS", "DDL"),
          RDMLDELTASTATS = @GETENV ("DELTASTATS", "DML")
         );
---------------------------------------------------------------------------------------------