Simple connector set up

This document describes a simple set up for retrieving data from an HTTP endpoint, splitting the given data, changing the split data and sending it to another HTTP endpoint.

To set up a simple connector httpbin.org is a simple resource to prove core features of Alumio. This document describes a simple set up for retrieving data from an HTTP endpoint, splitting the given data, changing the split data and sending it to another HTTP endpoint. 

Scenario 

A webservice offers slideshows which holds slides which need to be imported slide by slide into another webservice. The slideshow data is too rich for the destination, which does not accept “type” as an element for the data. Furthermore, it has incompatible data with the destination (“title” should be called “name”).  

Step by step 

To create a basic route in Alumio which connects with httpbin. 

  1. Log in to Alumio, e.g.: https://admin.alumio.com/yourenvironment
  2. Create an incoming configuration 
    1. Go to the Connections > Incoming page 
    2. Click the + button on the Incoming page 
    3. Enter a name: Slides from httpbin 
    4. Specify a subscriber: HTTP Subscriber 
    5. Enter the request URI: https://httpbin.org/json 
    6. Specify the HTTP Client: Default client 
    7. Add a transformer (click on the + Add transformers button)  
    8. Specify a transformer: Get branches from a pattern 
    9. Enter a pattern: slideshow.slides.* 
    10. Press the Save button 
  3. Create an outgoing configuration 
    1. Go to the Connections > Outgoing page 
    2. Click the + button on the Outgoing page 
    3. Enter a name: Slides to httpbin 
    4. Specify a publisher: HTTP Publisher 
    5. Enter the request URI: https://httpbin.org/anything 
    6. Specify the HTTP Client: Default client 
    7. Press the Save button 
  4. Create a route 
      1. Go to the Connections > Routes page 
      2. Click the + button on the Routes page 
      3. Enter a name: Slides from httpbin to httpbin 
      4. Specify an incoming configuration: Slides frohttpbin 
      5. Specify an outgoing configuration: Slides from httpbin 
      6. Press the Save button 

Now a basic route has been set up to retrieve data from httpbin and send it back.

Execute the route

To execute the route, please follow these steps:

  1. Go to the Connections > Incoming page 
  2. Click the Run button of the Slides from httpbin incoming configuration 
  3. Go to the Connections > Routes page 
  4. Click the Run button of the Slides from httpbin to httpbin route 
  5. Go to the Tasks page (and clear possible filters) 
  6. Select the task matching the route to view its details 

Apply data filters filters

To add a data filter to this route, please follow these steps:

  1. Go to the Connections > Transformers page 
  2. Click the + button on the Transformers page 
  3. Enter a name: Slides data filter 
  4. Enter a description: Filters 'type' from data 
  5. Specify a Prototype (dropdown under Settings): Data, transform data using mappers and conditions 
  6. Add a transformer (click on the + Add transformers button) 
  7. Specify a transformer: Key filter 
  8. Specify an accessor: Pattern accessor 
  9. Enter a pattern: * 
  10. Add a condition (click on the + Add conditions button)  
  11. Specify a condition: Equals 
  12. Specify the Value type (click the dropdown): string 
  13. Enter a value: type 
  14. Press the Save button 
  15. Go to the Connections > Incoming page 
  16. Go to the Incoming configuration page of Slideshows from httpbin 
  17. Scroll down and click the + Add transformers button 
  18. Specify the transformer: Slides data filter 
  19. Press the Save button

Add the data mapper to the route

To add a data mapper to this route, please follow these steps:

  1. Go to the Connections > Transformers page  
  2. Click the + button on the Transformers page  
  3. Enter a name: Slides data mapper 
  4. Enter a description: Maps 'title' to 'name' 
  5. Specify a Prototype (dropdown under Settings): Data, transform data using mappers and conditions  
  6. Add a transformer (click on the + Add transformers button)  
  7. Specify a transformer: Key mapper 
  8. Specify an accessor: Pattern accessor  
  9. Enter a pattern:  
  10. Add a mapper (click on the + Add mappers button)   
  11. Specify a mapper: Dictionary map 
  12. Add a map (click on the + Add map button) 
  13. Specify the Value types (click the dropdowns): string  
  14. Enter the first value: title 
  15. Enter the second value: name 
  16. Specify a comparator: Equals 
  17. Press the Save button  
  18. Go to the Connections > Incoming page  
  19. Go to the Incoming configuration page of Slideshows from httpbin  
  20. Scroll down and click the + Add transformers button  
  21. Specify the transformer: Slides data mapper 
  22. Press the Save button 

The following data is assumed to come from http (copy this): 



  "title": "Wake up to WonderWidgets!", 

  "type": "all" 

This data is also available from the task detail page for any task of this route. It can be found under the entity data tab. 

Test a Transformer

To test the transformers without running parts of a route, please follow these steps:

  1. Go to the Incoming > Transformers page 
  2. Select either Slides data filter or Slides data mapper 
  3. Paste the copied data in the top right text area 
  4. Press the Test button 
  5. Notice the changes in the data (type removed in Slides data filter, title renamed to name in Slides data mapper) 

Explaining the data which is incoming

Data from https://httpbin.org/json  



  "slideshow": { 

    "author": "Yours Truly",  

    "date": "date of publication",  

    "slides": [ 

      { 

        "title": "Wake up to WonderWidgets!",  

        "type": "all" 

      },  

      { 

        "items": [ 

          "Why <em>WonderWidgets</em> are great",  

          "Who <em>buys</em> WonderWidgets" 

        ],  

        "title": "Overview",  

        "type": "all" 

      } 

    ],  

    "title": "Sample Slide Show" 

  } 

Questions and answers 

  1. What is an Accessor?
    It allows Alumio to find data that is supposed to be addressed with transformers and other objects.
  2. What is an Accessor pattern? 
    It is a method to find any number of data points in the given data. An * (asterisk) is a wildcard when used in patterns and is used to find any data points in the structure.
  3. What is a Mapper?
    It translates a given value to another based on the configuration supplied. In the example above it translates the ‘title’ field to ‘name’.
  4. What is a Data filter?
    It filters data points which match the given configuration. In the example above it removes the ‘type’ field from the data set. 
  5. What is a Filter?
    A filter will prevent a task from being created when it matches the logic given to it. Using the slideshows as an example, it would be possible to filter slides that hold the ‘type’ field in the data. 
  6. What is the "Get branches from" a pattern transformer?
    It is used to split the slideshow data into several slide tasks, so it is possible to create multiple tasks from one data set. 
  7. How does this read/write data from/to a SOAP/REST/OpenAPI/etc. service?
    The incoming and outgoing configuration can be used to connect to different services. Now a simple HTTP client is configured for both sides, but it can be exchanged for something else. From databases to SOAP services, Alumio has many elements that can be configured using generic elements.