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
<Dictionary>
element.
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 the
button on the left to create a new dictionary entry.After that, specify its Name. You must also specify other properties of the entry:
Name
Specifies the name of the dictionary entry.
Names are case-sensitive and must be unique within the dictionary. Generally, the dictionary name does not have to be a valid java identifier. For example dictionary name in File URL attribute does not require this. We recommend using legal java identifiers as an access to dictionary in CTL requires the dictionary name to be a legal java identifier.
As Input
Specifies whether the dictionary entry can be used as input or not.
Its value can be true
or false
.
As Output
Specifies whether the dictionary entry can be used as output or not.
Its value can be true
or false
.
Type
Specifies the type of the dictionary entry.
Dictionary types are the following primitive CloverETL data types:
boolean
, byte
, date
, decimal
,
integer
, long
, number
, and string
.
Any of these can also be accessed in CTL2. See Dictionary in CTL2 for detailed information.
Additionally, there are two types of multi-value dictionary entries:
list
- a generic list of elements
map
- a generic mapping from keys to values
See Multivalue Fields for further information about multi-value data types in CloverETL.
Tip | |
---|---|
Both For example, if you create a dictionary entry
of the type Similarly, if you create a dictionary entry of the type
|
There are three other data types of dictionary entries (available in Java):
object
- CloverETL data type available
with CloverETL Engine.
readable.channel
- the input will be
read directly from the entry by the
Reader according to the configuration of
the Reader.
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.)
Content Type
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.
Initial Value
Default value of an entry - useful when executing your graph
without actually populating the dictionary with external data.
Note that not 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 right-hand
Properties pane. 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 corresponding button on the right and specify the following two properties:
Name
Specifies the name of the value of corresponding entry.
Value
Specifies the value of the name corresponding to an entry.