---
version: 47
data:

- type: "CustomParameter"
  variation: null
  lastChangedDate: "2026-07-23T12:12:13"
  lastChangedBy: "admin"
  replacePermissions: true
  replaceObject: true
  attributes:
    defaultValue: null
    description: null
    displayName: "Connection to check"
    dynamicOptionEntry: false
    optionEntryConnection: null
    optionEntryExpression: null
    optionEntryResultLimit: 100
    options: []
    parameterType: "CONNECTION"
    requirementLevel: "NONE"
    tags: []
    validationExpression: null
    validationType: "NONE"
    variableName: "connectionToCheck"

- type: "WorkflowTemplate"
  variation: null
  lastChangedDate: "2026-07-28T09:30:40"
  lastChangedBy: "admin"
  replacePermissions: true
  replaceObject: true
  attributes:
    connectionToCheck: null
    deleteExecutionFilesOnSuccess: "false"
    description: null
    displayName: "Check Connection"
    executionPlatform: "default"
    executionRetentionPeriod: "-1"
    libraries: []
    scriptLanguage: "GROOVY"
    tags: []
    taskExecutionReport: []
    workflow: "import java.sql.Connection\nimport java.sql.ResultSet\nimport java.util.logging.Level\n\
      import java.util.logging.Logger\n\ndef log = Logger.getLogger(\"de.ubs.xdm.custom.JdbcConnectionTest\"\
      )\n\ndef jdbcUrl  = workflow.connectionToCheck.url\ndef user     = workflow.connectionToCheck.credential.user\n\
      def password = workflow.connectionToCheck.credential.password\n\nlog.info(\"\
      ====== JDBC connection test ======\")\nlog.info(\"JDBC URL: ${jdbcUrl}\")\n\
      log.info(\"User    : ${user ?: '<none>'}\")\n\nlog.info(\"Starting connection-test\
      \ workflow.connectionToCheck.jdbcConnection ...\")\n\nConnection conn = null\n\
      try {\n    // 1. get Connection\n    conn = workflow.connectionToCheck.jdbcConnection\n\
      \    log.info(\"[OK] JDBC connection established.\")\n\n    // 2. Check simple\
      \ meta data\n    def meta = conn.metaData\n    ResultSet rs = meta.getTables(null,\
      \ null, \"%\", null)\n    log.info(\"[OK] Metadata accessible.\")\n    int count\
      \ = 0\n    while (rs.next() && count < 10) {\n        log.info(\" - \" + rs.getString(\"\
      TABLE_NAME\"))\n        count++\n    }\n    rs.close()\n    log.info(\"[OK]\
      \ JDBC connection test successfully executed.\")\n} catch (Exception e) {\n\
      \    \n    log.log(Level.WARNING, \"JDBC connection test failed: ${e.message}\"\
      , e)\n\n    log.warning(\"Typ    : ${e.getClass().name}\")\n    log.warning(\"\
      Message: ${e.message}\")\n\n    if (e.cause) {\n        log.warning(\"Cause\
      \    : ${e.cause.getClass().name}\")\n        log.warning(\"C-Message: ${e.cause.message}\"\
      )\n    }\n\n} finally {\n    if (conn != null) {\n        try {\n          \
      \  conn.close()\n            log.info(\"JDBC connection closed.\")\n       \
      \ } catch (ignored) {}\n    }\n}\n\nlog.info(\"Script finished.\")"
    workflowCallEntries: []
  children:
  - type: "Workflow"
    variation: null
    lastChangedDate: null
    lastChangedBy: "admin"
    replacePermissions: true
    replaceObject: true
    attributes:
      description: null
      displayName: "Run"
      tags: []