Creating a Simple Graph in a Few Simple Steps

After creating a new CloudConnect graph, it is an empty pane. In order to create a non-empty graph, you must fill the empty graph with components and other graph elements. You need to select graph components, set up their properties (attributes), connect these components by edges, select data files and/or database tables that should be read or unloaded from, written or loaded to, create metadata describing data, assign them to edges, create database connections or JMS connections, create lookup tables and/or create sequences and parameters. Once all of it is done, you can run the graph.

If you want to know what edges, metadata, connections, lookup tables, sequences or parameters are, see Part VIII, Graph Elements, Structures and Tools for information.

Now we will present you a simple example of how CloudConnect transformation graphs can be created using CloudConnect Designer. We will try to make the explanation as clear as possible.

First, you need to select components from the Palette of Components.

To select any component, click the triangle on the upper right corner of the Graph Editor pane. The Palette of Components will open. Select the components you want by clicking and then drag-and-dropping them to the Graph Editor pane.

For our demonstration purposes, select CSVReader from the Readers category of the Palette. Select also the GD Dataset Writer component from the Writers category.

Components Selected from the Palette

Figure 8.6. Components Selected from the Palette


Once you have inserted the components to the Graph Editor pane, you need to connect them by edges. Select the Edge tool on the Palette and click the output port of one component and connect it with the input port of another by clicking again. The newly connected edges are still dashed. Close the Palette by clicking the triangle at its upper right corner. (See Chapter 27, Edges for more information about Edges.)

Components are Connected by Edges

Figure 8.7. Components are Connected by Edges


Now right-click the edge and select New metadataExtract from flat file from the pop-up menu that appears beside the edge.

Extracting Metadata

Figure 8.8. Extracting Metadata


The Flat file dialog appears.

Flat File Dialog

Figure 8.9. Flat File Dialog


Click on the Browse button and select the quotes.csv from the demodata/quotes directory in the Workspace view tab of the URL Dialog that pops up.

URL Dialog

Figure 8.10. URL Dialog


Then select the UTF-8 encoding and the Delimited record type in the Flat file dialog and click on the Next button.

Encoding and Record Type in the Flat File Dialog

Figure 8.11. Encoding and Record Type in the Flat File Dialog


The Metadata editor appears. The Designer parses the CSV file and guesses the file metadata. Then select the double-quote character in the Quote char listbox, make sure that both Extract names and Normalize names checkboxes are checked and click on the Reparse button. The field data types should be now guessed. Now double-check that all _Price fields are numbers. Change the type of the Date field to date. Change the type of the Volume field to long and type of the Id field to string.

Metadata Editor

Figure 8.12. Metadata Editor


After clicking Finish, metadata is created and assigned to the edge. The edge is solid now.

Edge Has Been Assigned Metadata

Figure 8.13. Edge Has Been Assigned Metadata


Now, double-click CSVReader, click the File URL attribute row and click the ... button that appears at the end of the edit line.

(You can see CSVReader for more information about CSVReader.)

File URL Editing

Figure 8.14. File URL Editing


After that, URL File Dialog will open. Select the demodata/quotes/quotes.csv file again.

Selecting the Input File

Figure 8.15. Selecting the Input File


Then check the Quoted strings option, set the Charset to UTF-8, Quote character to double-quote and Number of skipped records to 1. Then click OK. The parameters should look like this:

CSV Reader Settings

Figure 8.16. CSV Reader Settings


Click OK to close the CSVReader editor.

Now we configure the GD Dataset Writer component. Double-click on it, point the cursor to the Data set property text field and click on the ... button at the end of the text field. Select the Quotes dataset in the Choose a dataset popup dialog.

Choose a dataset Dialog

Figure 8.17. Choose a dataset Dialog


Now configure the Field mapping property that maps the input edge metadata fields to the GoodData dataset structure. Click on the ... button at the end of the Field mapping editor. The dialog that pops up contains the dataset attributes, facts and references on the left and the input metadata fields on the right. Most of the field should be correctly pre-selected. Configure the dialog according to the figure below and click the Next button.

Field mapping Dialog

Figure 8.18. Field mapping Dialog


Then select the Symbol field as the identifier of the Symbol attribute and click the Finish button.

Primary label Dialog

Figure 8.19. Primary label Dialog


Click OK to close the GD Dataset Writer editor and save the graph by pressing Ctrl+S .

Now right-click in any place of the Graph Editor (outside any component or edge) and select Run AsETL graph .

(Ways how graphs can be run are described in Chapter 9, Running CloudConnect Graphs.)

Running the Graph

Figure 8.20. Running the Graph


Once graph runs successfully, blue circles are displayed on the components and numbers of parsed records can be seen below the edges:

Result of Successful Run of the Graph

Figure 8.21. Result of Successful Run of the Graph