Creating a Dictionary
The dictionary specification provides so called "interface" of the graph and is always required, even, for example, when the graph is used with Launch Service.
In the source code, the entries of the dictionary are specified inside the
To create a dictionary, right-click the Dictionary item in the Outline pane and choose from the context menu. The Dictionary editor will open.
Figure 38.1. Dictionary Dialog with Defined Entries
Click thebutton on the left to create a new dictionary entry.
After that, specify its Name. You must also specify other properties of the entry:
Specifies the name of the dictionary entry.
Names are case-sensitive and must be unique within the dictionary. Generally, a dictionary name does not have to be a valid Java identifier. For example, a dictionary name in the
>File URLattribute does not require this condition to be met. We recommend using legal Java identifiers since an access to a dictionary in CTL requires the dictionary name to be a legal Java identifier.
Specifies whether the dictionary entry can be used as an input or not. Its value can be
Specifies whether the dictionary entry can be used as an output or not. Its value can be
Specifies the type of the dictionary entry.
Dictionary types are the following primitive CloverDX data types:
Any of these can also be accessed in CTL2. For detailed information, see Dictionary in CTL2.
Additionally, there are two types of multi-value dictionary entries:
list- a generic list of elements
map- a generic mapping from keys to values
For further information about multi-value data types in CloverDX, see Multivalue Fields.
mapdictionary entries can also be accessed in CTL2, but you need to specify the type of elements of the list or map in the Content Type column, see the picture below:
For example, if you create a dictionary entry of the type
listand set the Content Type to
integer, you can access the entry in CTL2 as
integer- a list of integers.
Similarly, if you create a dictionary entry of the type
mapand set the Content Type to
number, you can access the entry in CTL2 as
map[string, number]- a mapping from
numbervalues (the keys are always assumed to be of the
There are three other data types of dictionary entries (available in Java):
object- CloverDX data type available with CloverDX Engine.
readable.channel- the input will be read directly from the entry by the Reader according to its configuration. Therefore, the entry must contain data in valid format.
writable.channel- the output will be written directly to this entry in the format given by the output Writer (e.g. text file, XLS file, etc.)
This specifies the content type of the output entry. This content type will be used, for example, when the graph is launched via Launch Service to send the results back to user.
A default value of an entry - useful when executing the graph without actually populating the dictionary with external data. Note that you cannot edit this field for all data types (e.g.
object). As you set a new Initial Value, a corresponding name-value pair is created in the Properties pane on the right. Initial value is therefore the same as the first value you have created in that pane.
Each entry can have some properties (name and value). To specify them, click the corresponding button on the right and specify the following two properties:
Specifies the name of the value of corresponding entry.
Specifies the value of the name corresponding to an entry.