<span metal:use-macro="container/Zuite_viewWendelinTestMacroLibrary/macros/init_wendelin_test_environment">Init Wendlin Test Environment</span>

# Agenda

- Create Data Supply
- Create Data Supply Lines

This tutorial teaches how to create Data Supply to prepare Wendelin to receive data sent by fluentd from IoT Gateway.

# Data Supplies

On the modules page click on Data Supplies.

# Add

Click on Add button to add new Data Supply.

# Create Document

Continue with clicking on Create Document.

openAndWait | ${default_front_url} |
waitForElementPresent | //a[contains(@href,'page=front')] |
click | //a[contains(@href,'page=front')] |
waitForElementPresent | //a[contains(@href,'data_supply_module')] |
click | //a[contains(@href,'data_supply_module')] |
waitForElementPresent | //a[@data-i18n="Add"] |
click | //a[@data-i18n="Add"] |
waitForElementPresent | //input[@type="submit" and @value="Create Document"] |
pause | 3000 |
click | //input[@type="submit" and @value="Create Document"] |

# Fill the Form

First fill in the Title and Reference for the Data Supply.

Pay attention on the reference, we name it simply sensor_1 as we have only 1 sensor that will be sending data to wendelin.

This reference will be used in later tutorials when we will configure fluentd.

# Fill the Form Cont.

Imagine an example of a Sample Company that owns a Sample Factory where is a sensor that sends data to wendelin.

Then the source of the data is Sample Factory.

Source - where data comes from.

# Fill the Form Cont.

Continuing the example, the Source Section is Sample Company.

Source Section - owner of data before the ingestion.

# Fill the Form Cont.

Destination - physical place where data is stored.

Destination Section - owner of data after ingestion. Can be the same as the source.

waitForElementPresent | //input[@id="field_my_title"] |
type | //input[@id="field_my_title"] | Environment Sensor
type | //input[@id="field_my_reference"] | sensor_1
type | //input[@id="field_my_version"] | 001
type | //input[@id="field_my_source_title"] | Sample Factory
fireEvent | //input[@name='field_my_source_title'] | input
waitForElementPresent | //li[@name='Organisation'] |
click | //li[@name='Organisation'] |
type | //input[@id="field_my_source_section_title"] | Sample Company
fireEvent | //input[@name='field_my_source_section_title'] | input
waitForElementPresent | //li[@name='Organisation'] |
click | //li[@name='Organisation'] |
type | //input[@id="field_my_destination_title"] | Nexedi Data Center
fireEvent | //input[@name='field_my_destination_title'] | input
waitForElementPresent | //li[@name='Organisation'] |
click | //li[@name='Organisation'] |
click | //button[@name="submit" and @data-i18n="Save"] |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block>
waitForElementPresent | //button[@type="submit" and @class="success"] |
waitForElementPresent | //a[contains(@href,'Dvalidate_action')] |
click | //a[contains(@href,'Dvalidate_action')] |
waitForElementPresent | //input[@type="submit" and @value="Validate"] |
click | //input[@type="submit" and @value="Validate"] |
waitForElementPresent | //button[@type="submit" and @class="success"] |
waitForElementPresent | //label[@for="field_my_translated_validation_state_title"] |
assertTextPresent | Validated |
waitForElementPresent | //input[@id="field_my_destination_section_title"] |
type | //input[@id="field_my_destination_section_title"] | Sample Company
fireEvent | //input[@name='field_my_destination_section_title'] | input
waitForElementPresent | //li[@name='Organisation'] |
click | //li[@name='Organisation'] |
click | //button[@name="submit" and @data-i18n="Save"] |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block>
waitForElementPresent | //button[@type="submit" and @class="success"] |

# Save

After click on Save button to save the changes.

# Validate

After it is saved, click on Validate on left side panel to validate the Data Supply.

# Confirm Valdation

Click on Validate to confirm validation.

# Add Data Supply Line

Click on Add button to add Data Supply Line.

# Create Document

Continue with clicking on Create Document.

# Fill the Form

Title: Ingest Bucket Data

Reference: ingestion_operation

For Product or Service - data operation by default exists in wendelin. when you type in the field Ingest Data from drop down list choose the existing one.

# Fill the Form Cont.

For Item we choose Data Acquisition Unit that we created in the previous tutorial.

# Save

After click on Save button to save the changes.

# Back to Data Supply

Click on Data Supply Line: Ingest Bucket Data to go back and create another Data Supply line

waitForElementPresent | //a[@data-i18n="Add"] |
click | //a[@data-i18n="Add"] |
waitForElementPresent | //input[@type="submit" and @value="Create Document"] |
click | //input[@type="submit" and @value="Create Document"] |
waitForElementPresent | //input[@id="field_my_title"] |
type | //input[@id="field_my_title"] | Ingest Bucket Data
type | //input[@id="field_my_reference"] | ingestion_operation
type | //input[@id="field_my_resource_title"] | Ingest Data
fireEvent | //input[@name='field_my_resource_title'] | input
waitForElementPresent | //li[contains(@data-relative-url,'data_operation_module/')] |
click | //li[contains(@data-relative-url,'data_operation_module/')] |
type | //input[@id="field_my_aggregate_title_list"] | Olimex Environment Sensor
fireEvent | //input[@name='field_my_aggregate_title_list'] | input
waitForElementPresent | //li[contains(@data-relative-url,'data_acquisition_unit_module/')] |
click | //li[contains(@data-relative-url,'data_acquisition_unit_module/')] |
click | //button[@name="submit" and @data-i18n="Save"] |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block>
waitForElementPresent | //button[@type="submit" and @class="success"] |
click | //a[contains(@data-i18n, 'Data Supply Line')] |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block>

# Add Data Supply Line

Click on Add button to add Data Supply Line.

# Create Document

Continue with clicking on Create Document.

# Fill the Form

Title: Sample Environment Data

Reference: out_stream

For Product or Service we choose Data Product that we created in the previous tutorial.

# Fill the Form Cont.

For Use from drop down list choose Big Data/Ingestion/Stream Ingestion.

# Save

After click on Save button to save the changes.

# Data Supply

Data Supply with Data Supply Lines is ready.

waitForElementPresent | //a[@data-i18n="Add"] |
click | //a[@data-i18n="Add"] |
waitForElementPresent | //input[@type="submit" and @value="Create Document"] |
click | //input[@type="submit" and @value="Create Document"] |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block>
waitForElementPresent | //input[@id="field_my_title"] |
type | //input[@id="field_my_title"] | Sample Environment Data
type | //input[@id="field_my_reference"] | out_stream
type | //input[@id="field_my_resource_title"] | Sample Environment Raw Data
fireEvent | //input[@name='field_my_resource_title'] | input
waitForElementPresent | //li[contains(@data-relative-url,'data_product_module/')] |
click | //li[contains(@data-relative-url,'data_product_module/')] |
select | //select[@id="field_my_use"] | Big Data/Ingestion/Stream Ingestion
click | //button[@name="submit" and @data-i18n="Save"] |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block>
waitForElementPresent | //button[@type="submit" and @class="success"] |
click | //a[contains(@data-i18n, 'Data Supply Line')] |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded"> </tal:block>
verifyElementPresent | //input[@value="ingestion_operation"] |
verifyElementPresent | //input[@value="out_stream"] |
openAndWait | ${base_url}/Zuite_waitForActivities |
assertTextPresent | Done. |
open | ${base_url}/Ingestion_ingestDataStream?reference=sensor_1-sample-environment-raw-data |
assertTextPresent | Data ingested |