Welcome to the Alteryx Knowledge Base

DCM: Setting Up DCM Connection Handling Rules
user

Created/Edited - 12/6/2024 by Marcela Abrach | Alteryx

Question

How do I set up DCM connection handling rules?

 

Answer

DCM Environment Connection Handling rules allow you to define what connections present on the Server should be used instead of workflow connections when executing workflows on the Server.

For every environment, you can define a list of Connection IDs that should be replaced by a different connection when found in workflow during execution. This means that for such an environment, each of the source Connection IDs (present in the workflow) will be resolved as the target connection (defined by Connection ID) at engine runtime.

 

To see Environment Connection Handling in action, watch the video in the Introducing Alteryx DCM Environment Connection Handling Community article.
 

Obtaining Source Connection ID

These steps provide a quick way to locate and use the source connection ID for Alteryx DCM Connection Handling Rules.

From the FSO:

  1. Select the tool on the canvas to bring up the Configuration pane.
  2. Locate the Connection ID value.

image.png

From the workflow XML:

  1. Open Alteryx Designer and navigate to Options > User Settings > Edit User Settings.
  2. Check the “Display XML in Properties Window”.
  3. Open the tool properties window and select the XML View icon <> on the top left of the window to view the source code.
  4. Look for the <Connection> element to find the Id value of the said connection

 

Example (Workflow XML):

<AlteryxDocument>
    <Connections>
        <Connection Name="SourceDatabaseConnection" Id="12345" Type="Database">
            <!-- Other connection details -->
        </Connection>
    </Connections>
    <Workflows>
        <Workflow>
            <ConnectionHandlingRules>
                <ConnectionHandlingRule>
                    <SourceConnectionId>12345</SourceConnectionId>
                    <!-- Other rule details -->
                </ConnectionHandlingRule>
            </ConnectionHandlingRules>
        </Workflow>
    </Workflows>
</AlteryxDocument>

 

In this example:

  • <Connection> element's Id attribute (12345) is the source connection ID.
  • <SourceConnectionId> under <ConnectionHandlingRule> references this ID.

Alternatively, the Connection ID can be obtained from the Input Tool configuration.

 

image.png

 


Create a DCM Environment Connection Handling Rule

DCM handles connection replacement dynamically at the execution, without updating the YXMD workflow.

To create a DCM Environment Connection Handling rule:

  1. Go to Admin > DCM Connection Handling.
  2. Select + New in the upper right corner next to the Search field.
  3. In the Create Rule window:
    • Enter Source Connection ID - the Connection ID present in the workflow. It doesn’t have to be present on the current environment. It can’t be used in any other rule as either source or target connection.
    • Specify Source Connection Name - a custom name used only for better navigation.
    • Select Target Connection - an existing connection on the current environment that will be used during execution. The target connection can’t be used as a source connection in any other rule on the same environment. Multiple rules can however reference the same target connection (multiple references would then be executed using the same connection).
  4. Select Create.


You can also import DCM Environment Connection Handling rules. For the import, you need a JSON file with exported DCM connections. For more information on how to export DCM connections, go to Export DCM Connections.
 

  1. Go to Admin > DCM Connection Handling.
  2. Select Import in the upper right corner next to the Search field.
  3. In the Import Rules window, select Upload File. Select the JSON file to upload. The same validations for source and target connections are applied as if creating a new rule.
  4. Select Import.

By default, the exported file only contains the source connections, with no target connections defined. You can specify those by editing the rule in the UI after the import. Rules with no target connection defined are ignored at execution, and the original workflow reference is therefore used.

Optionally, you can manually edit the source file, either by customizing the list of connections to be imported, or by filling in target connections to the JSON file prior to import. The target connections can be defined by adding a targetConnection object containing only a connectionId reference to an existing connection on the environment, as seen on the following example.



Example

Exported file: Refer to the DCM Connections page for an example of an exported JSON file.

Imported file: Example of an import file with target connections defined:

{
  "apiVersion": 5,
  "connections": [
    {
      "sourceConnection": {
        "connectionId": "c.cid.123b5925-e1e5-4568-a2cc-83c74eee8a6e",
        "connectionTitle": "Snowflake TEST - read_access (john.doe@alteryx.com)"
      },
      "targetConnection": {
        "connectionId": "c.cid.b36bd9b6-23a1-43ba-a4a4-c68c488d7f8c"
      }
    },
    {
      "sourceConnection": {
        "connectionId": "c.cid.456936dd-d0fd-4498-bc74-e550ea6a22c6",
        "connectionTitle": "SQL Server DEV - mssql read (john.doe@alteryx.com)"
      },
      "targetConnection": {
        "connectionId": "c.cid.9893e798-1324-489a-a036-83ed4fc1ec55",
      }
    }
  ]
}



 

Additional Information
Was this article helpful?