TC2.13 - Import of any new Block/MicroService or library of MicroServices into IOT Application Builder tools

Test Case Title

TC2.13 - Import of any new Block/MicroService or library of MicroServices into IOT Application Builder tools

Goal

The goal is to demonstrate how, using Node-RED, an user can import and export flows to a Sna4City repository

Prerequisites

Using a PC or Mobile with a web browser.

The following functionalities are available only for specific Snap4city users with specific privileges

Expected successful result

Exporting/importing flows to/from the Snap4city repository via Nodered

Steps

See details above

 

To add or to export flows to or from Node-RED you can use different strategies. Beside the default option for importing and exporting flows through the clipboard and the Node-RED library, snap4city offers the possibility to export or import them by using the Snap4City repository. Node-RED Flows are JSON documents, so you can choose to store a flow in the repository or to load a flow developed by other users and to put it in the current tab. We remark that when a flow is stored in the repository, it is considered private of the current user. The user can make it public by accessing the resource from the snap4city portal.

 

Importing a flow using Snap4City repository

  1. Open a Flow in your cloud (TC2.1a) or local (TC2.1b) IotApplication
    1. It is empty
    2. On the top menu then select import -> Import:
    3. This will open a dialog box where you can import the flow from S4C
    4. Clicking on “Import S4C” a box appears with a list of public flows that it is possible to import. Select the name of the flow that you want import (for example Thermometer>airConditioner)
    5. The corresponding JSON File is pasted into the dialog box then press the import button
    6. In the canvas of Node-RED a new flow appears. Specifically, the flow Thermometer>airConditioner checks the value of the thermometer. If the temperature is greater than 22 degrees, the air conditioner (a device registered in the Context Broker) is turned on otherwise is turned off

 
Exporting a flow using Snap4City repository

  1. Open a Flow in your cloud (TC2.1a) or local (TC2.1b) IotApplication
    1. In order to export the flows, select them (clicking on CTRL-a all the blocks of the current tabs are selected)
    2. On the  top menu then select import -> Export:
    3. This will open a dialog box where you can export and save the flow to S4C: in this dialog you can choose if export the selected nodes, the current flow  or all flows in the editor.
    4. By clicking on “Save S4C”, a box appears that already contains the selected flow.
    5. Digit a title.
    6. Then you need to specify:
      1. Nature, (i.e the Nature of the data managed but the flow);
      2. Sub-Nature (i.e. a more detailed flow description);
      3. Description (i.e. a more detailed description of what the flow do)
    7. All fields are mandatory. At the end click on the button “Save S4C” (the button Cancel clear the all fields of the box)
  2. The flow is export as private and so owned by your user. In order to be visualized on the list of the public list of flows you need to:
    1. Go to the snap4city home page 
    2. Make the login
    3. If the your role is AreaManager on the left  you can click on the “Resource Manager: Process Loader > Resources” menu to view all private resources and the related metadata. In this page each user can see the details and can upload; modify; publish its own resources
    4. Order the content of the table by using the column “Upload Date” from the most recent
    5. You can see your new exported flow “temperature to a mqtt channel” and by using the column “published”, set it to YES for changing the status to “public”
  3. Then if you come back to Node-RED, you can see, by selecting import -> Import -> Import S4C, this new flow in the list of public flows

     See also TC2.29 and TC2.31
TC2.13 - Import of any new Block/MicroService or library of MicroServices into IOT Application Builder tools | Snap4City

Error

×

Error message

  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in og_field_access() (line 578 of /var/www/html/drupal/sites/default/modules/og/og.module).
  • Notice: Trying to get property of non-object in user_access() (line 806 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 818 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 819 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 825 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 828 of /var/www/html/drupal/modules/user/user.module).
  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/drupal/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/drupal/includes/bootstrap.inc).
  • Error: __clone method called on non-object in og_user_access_entity() (line 2249 of /var/www/html/drupal/sites/default/modules/og/og.module).
The website encountered an unexpected error. Please try again later.