syntax to use dictionary value as component config

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

Morganizer
Posts: 1
Joined: Fri Apr 23, 2021 10:37 pm

syntax to use dictionary value as component config

Postby Morganizer » Fri Oct 29, 2021 2:43 pm

I need to be able pass a dictionary values to attribute fields of a graph components, in this case to the Username and Password of an HTTPConnector.

Where in the console log I might see something like:
DictEntry:user:string:{value=dynamicusername}

I have unsuccessfully tried many variations in the fields, including:

DictEntry:user
dictionary.user
//#CTL2 dictionary.user

I see in the documentation special instructions about the syntax for doing so in URL fields, but no reference to using dictionaries in other fields.

habrzettlovah
Posts: 7
Joined: Tue Jun 01, 2021 9:59 am

Re: syntax to use dictionary value as component config

Postby habrzettlovah » Mon Nov 08, 2021 2:41 pm

Hello,

Since dictionary entries were not designed to be used to pass information directly into component properties, it is not possible to use them in this way (the only exception is the standard File URL field in Reader or Writer components (and, of course, dictionary entries can be used in CTL without any limitation)).

In the case of the HTTPConnector component, the easiest way to pull the Username and Password values from a dictionary is to use the Input Mapping in the HTTPConnector. I have attached two sample graphs (in ExecuteGraph-Dictionary.zip) to illustrate how the Input Mapping can be used: One includes the ExecuteGraph component where Input mapping is used to put Username and Password into dictionary entries, and the other one is a graph with the HTTPConnector component where Input Mapping is used to pull the dictionary entries into Password and Username fields.

Another way of pulling dictionary entries into component properties is to use Input Mapping to link dictionary values to parameters in a (sub)graph. I have attached a second zip file (Subgraph-Dictionary-Parameters.zip) to illustrate how dictionary entries can be linked to parameters in subgraphs.

Hope this helps!

Best regards

Hana
Attachments
ExecuteGraph-Dictionary.zip
(1.83 KiB) Downloaded 15 times
Subgraph-Dictionary-Parameters.zip
(2.45 KiB) Downloaded 15 times
---
Hana Habrzettlova
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com