---
version: 38
data:

  - type: "Connection"
    variation: "db2-luw-connection"
    lastChangedDate: "2025-07-02T17:06:38"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      connectionPoolSize: "2"
      credential: "Dummy"
      dataExtractGenericFetchSize: "400"
      db2Group: ""
      db2Profile: "/home/db2inst1/sqllib/db2profile"
      description: null
      displayName: "A-Umgebung"
      extractPackageSize: "400"
      jdbcBatchActivated: "true"
      jdbcBatchSize: "500"
      luwCopyToPath: ""
      luwPathPattern: ""
      modificationSets: []
      storageLocation: null
      tags: []
      threadCount: "4"
      url: "jdbc:db2://q-server:50000/Q-DB"

  - type: "Connection"
    variation: "db2-luw-connection"
    lastChangedDate: "2025-07-02T17:07:07"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      connectionPoolSize: "2"
      credential: "Dummy"
      dataExtractGenericFetchSize: "400"
      db2Group: ""
      db2Profile: "/home/db2inst1/sqllib/db2profile"
      description: null
      displayName: "B-Umgebung"
      extractPackageSize: "400"
      jdbcBatchActivated: "true"
      jdbcBatchSize: "500"
      luwCopyToPath: ""
      luwPathPattern: ""
      modificationSets: []
      storageLocation: null
      tags: []
      threadCount: "4"
      url: "jdbc:db2://t-server:50000/T-DB"

  - type: "Connection"
    variation: "db2-luw-connection"
    lastChangedDate: "2025-07-02T17:06:54"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      connectionPoolSize: "2"
      credential: "Dummy"
      dataExtractGenericFetchSize: "400"
      db2Group: ""
      db2Profile: "/home/db2inst1/sqllib/db2profile"
      description: null
      displayName: "C-Umgebung"
      extractPackageSize: "400"
      jdbcBatchActivated: "true"
      jdbcBatchSize: "500"
      luwCopyToPath: ""
      luwPathPattern: ""
      modificationSets: []
      storageLocation: null
      tags: []
      threadCount: "4"
      url: "jdbc:db2://f-server:50000/F-DB"

  - type: "Credential"
    variation: null
    lastChangedDate: "2025-07-02T17:03:25"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      certificateBasedAuthentication: false
      description: null
      displayName: "Dummy"
      keyFormat: null
      password: "{aes}2970a8615420dd7eaa7b973541246eea3297c9ca7530afec37d91f26d37f545b"
      privateKey: null
      tags: []
      user: "dummy"

  - type: "CustomParameter"
    variation: null
    lastChangedDate: "2025-07-02T11:01:22"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      defaultValue: null
      description: "Enthält den Buchstaben, der in Schemaname und Tabellenname den Datenbanknamen\
      \ der Quelle kennzeichnet"
      displayName: "Source Environment Letter"
      dynamicOptionEntry: false
      optionEntryConnection: null
      optionEntryExpression: null
      optionEntryResultLimit: 100
      options:
        - displayName: "A-Umgebung"
          value: "A"
        - displayName: "B-Umgebung"
          value: "B"
        - displayName: "C-Umgebung"
          value: "C"
      parameterType: "STRING"
      requirementLevel: "NONE"
      tags: []
      validationExpression: null
      validationType: "NONE"
      variableName: "sourceLetter"

  - type: "CustomParameter"
    variation: null
    lastChangedDate: "2025-07-02T11:02:44"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      defaultValue: null
      description: "Enthält den Buchstaben, der in Schemaname und Tabellenname den Datenbanknamen\
      \ des Ziels kennzeichnet"
      displayName: "Target Environment Letter"
      dynamicOptionEntry: false
      optionEntryConnection: null
      optionEntryExpression: null
      optionEntryResultLimit: 100
      options:
        - displayName: "A-Umgebung"
          value: "A"
        - displayName: "B-Umgebung"
          value: "B"
        - displayName: "C-Umgebung"
          value: "C"
      parameterType: "STRING"
      requirementLevel: "NONE"
      tags: []
      validationExpression: null
      validationType: "NONE"
      variableName: "targetLetter"

  - type: "CustomParameter"
    variation: null
    lastChangedDate: "2025-07-02T14:23:50"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      defaultValue: null
      description: "Connection für die Quellumgebung"
      displayName: "My Source Connection"
      dynamicOptionEntry: false
      optionEntryConnection: null
      optionEntryExpression: null
      optionEntryResultLimit: 100
      options:
        - displayName: "A-Umgebung"
          value: "A-Umgebung"
        - displayName: "B-Umgebung"
          value: "B-Umgebung"
        - displayName: "C-Umgebung"
          value: "C-Umgebung"
      parameterType: "CONNECTION"
      requirementLevel: "NONE"
      tags: []
      validationExpression: null
      validationType: "NONE"
      variableName: "mySource"

  - type: "CustomParameter"
    variation: null
    lastChangedDate: "2025-07-02T14:25:04"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      defaultValue: null
      description: "Connection für die Zielumgebung"
      displayName: "My Target Connection"
      dynamicOptionEntry: false
      optionEntryConnection: null
      optionEntryExpression: null
      optionEntryResultLimit: 100
      options:
        - displayName: "A-Umgebung"
          value: "A-Umgebung"
        - displayName: "B-Umgebung"
          value: "B-Umgebung"
        - displayName: "C-Umgebung"
          value: "B-Umgebung"
      parameterType: "CONNECTION"
      requirementLevel: "NONE"
      tags: []
      validationExpression: null
      validationType: "NONE"
      variableName: "myTarget"

  - type: "TaskTemplate"
    variation: "compatibility-table-copy-task-template"
    lastChangedDate: "2025-07-02T14:32:27"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      checkUniquenessAfterModification: "true"
      cmpevalAbortOnEmptyTableSet: "false"
      deactivateHistoryTableForLoad: "false"
      deactivateIdentityValueAdaption: "false"
      deactivateLoggingBeforeApply: "false"
      deleteExecutionFilesOnSuccess: "false"
      description: null
      displayName: "XHLP-4385"
      dropOption: "NOTHING"
      dropRestrictOnDrop: "false"
      executionPlatform: "default"
      executionRetentionPeriod: "-1"
      extractTraceActive: "false"
      fillMode: "TABLE_REPLACE"
      foreignKeyDeactivation: "NONE"
      generateAlias: "true"
      generateComment: "true"
      generateForeignKey: "true"
      generateGrant: "true"
      incompatibleAction: "ABORT"
      jdbcProfiling: "false"
      logLevel: "INFO"
      modificationSet: []
      modificationValidation: "false"
      parallelModification: "true"
      resumeSubsetApply: "false"
      sourceConnection: "A-Umgebung"
      sourceLetter: "T"
      sqlApplyProfiling: "false"
      stopSource: "TABLESPACE"
      tags: []
      targetConnection: "C-Umgebung"
      targetLetter: "F"
      taskExecutionReport: []
      tolerationMode: "1"
      traceDataConfiguration: null
      useDelimiter: "true"
      usingAliasedTables: "false"
      usingViewedTables: "false"
    children:
      - type: "MappingRule"
        variation: null
        lastChangedDate: "2025-07-02T11:12:23"
        lastChangedBy: "admin"
        replacePermissions: false
        replaceObject: true
        attributes:
          active: true
          description: null
          fieldSelectionMode: "SIMPLE"
          fieldType: "SCHEMA"
          objectType: "ANY"
          sourceSelectionPattern: "DB2${sourceLetter}"
          tags: []
          targetValue: "%${targetLetter}"
          targetValueMode: "SIMPLE_PATTERN"
      - type: "MappingRule"
        variation: null
        lastChangedDate: "2025-07-02T11:14:21"
        lastChangedBy: "admin"
        replacePermissions: false
        replaceObject: true
        attributes:
          active: true
          description: null
          fieldSelectionMode: "SIMPLE"
          fieldType: "NAME"
          objectType: "TABLE"
          sourceSelectionPattern: "TEST${sourceLetter}"
          tags: []
          targetValue: "%${targetLetter}"
          targetValueMode: "SIMPLE_PATTERN"
      - type: "SelectionRule"
        variation: null
        lastChangedDate: "2025-07-02T11:11:35"
        lastChangedBy: "admin"
        replacePermissions: false
        replaceObject: true
        attributes:
          active: true
          applicationModel: null
          description: null
          namePattern: "TEST${sourceLetter}"
          objectType: "TABLE"
          schemaPattern: "DB2${sourceLetter}"
          selectionType: "PATTERN"
          tags: []
          version: null
      - type: "Task"
        variation: null
        lastChangedDate: "2025-07-02T11:15:36"
        lastChangedBy: "admin"
        replacePermissions: false
        replaceObject: true
        attributes:
          description: null
          displayName: "T1"
          tags: []

  - type: "WorkflowTemplate"
    variation: null
    lastChangedDate: "2025-07-02T17:02:57"
    lastChangedBy: "admin"
    replacePermissions: false
    replaceObject: true
    attributes:
      deleteExecutionFilesOnSuccess: "false"
      description: null
      displayName: "XHLP-4385"
      executionPlatform: "default"
      executionRetentionPeriod: "-1"
      libraries: []
      mySource: null
      myTarget: null
      scriptLanguage: "GROOVY"
      tags: []
      taskExecutionReport: []
      workflow: |-
        def sourceConnectionName = workflow.mySource.displayName;
        def targetConnectionName = workflow.myTarget.displayName;
        
        sourceConnectionLetter = "";
        targetConnectionLetter = "";
        
        if (sourceConnectionName.startsWith("Q")) {
          sourceConnectionLetter = "Q";
        }
        
        if (sourceConnectionName.startsWith("T")) {
          sourceConnectionLetter = "T";
        }
        
        if (sourceConnectionName.startsWith("F")) {
          sourceConnectionLetter = "F";
        }
        
        if (targetConnectionName.startsWith("Q")) {
          targetConnectionLetter = "Q";
        }
        
        if (targetConnectionName.startsWith("T")) {
          targetConnectionLetter = "T";
        }
        
        if (targetConnectionName.startsWith("F")) {
          targetConnectionLetter = "F";
        }
        
        TaskTemplateRunner()
           .taskTemplate('XHLP-4385')
           .taskNamePattern('Workflow of ${taskTemplate.displayName} at ${.now?iso_local}')
           .parameter('sourceConnection', workflow.mySource)
           .parameter('targetConnection', workflow.myTarget)
           .parameter('sourceLetter', sourceConnectionLetter)
           .parameter('targetLetter', targetConnectionLetter)
           .run();
      workflowCallEntries:
        - parent: null
          type: "TASK_TEMPLATE"
          object: "XHLP-4385"
    children:
      - type: "Workflow"
        variation: null
        lastChangedDate: "2025-07-02T14:28:15"
        lastChangedBy: "admin"
        replacePermissions: false
        replaceObject: true
        attributes:
          description: null
          displayName: "W1"
          mySource: "A-Umgebung"
          myTarget: "B-Umgebung"
          tags: []