[InterSystems IRIS for the First Time] Let’s use Interoperability
Tags: beginners, programming, tutorial, interoperability
Published: 2022-10-16 17:49:18

Hello, everyone!

InterSystems IRIS has a menu called **<span style="background-color:#f1c40f;">Interoperability</span>**.

It provides mechanisms to easily create system integrations (adapters, record maps, BPMs, data conversions, etc.) so different systems can be easily connected.

A variety of operations can be included in the data relay process, as examples we can cite: to connect systems that are not normally connected, data can be received (or sent) according to the specifications of the destination system. Also, information can be acquired and added from another system before sending the data. As well as, information can be acquired and updated from a database (IRIS or other).

In this series of articles, we will discuss the following topics while looking at <a href="https://github.com/Intersystems-jp/selflearning-interoperability" target="_blank">sample code</a> to help you understand how it works and what kind of development is required when integrating systems with Interoperability.

* <a href="https://community.intersystems.com/post/intersystems-iris-first-time-interoperability-lets-learn-how-it-works" target="_blank">How it works</a>
* <a href="https://community.intersystems.com/post/intersystems-iris-first-time-interoperability-what-prodction" target="_blank">What a Production is</a>
* <a href="https://community.intersystems.com/post/intersystems-iris-first-time-interoperability-message" target="_blank">Message</a>
* Component Creation
  * <a href="https://community.intersystems.com/post/intersystems-iris-first-time-interoperability-creating-components-business-operation" target="_blank">Business Operations</a>
  * <a href="https://community.intersystems.com/post/intersystems-iris-first-time-interoperability-creating-components-business-process" target="_blank">Business Processes</a>
  * <a href="https://community.intersystems.com/post/intersystems-iris-first-time-interoperability-creating-components-business-services" target="_blank">Business Services</a>

First, let me introduce you to the case study we will be using in this series.

> <span style="color:#2980b9;">A company operates a shopping site and is changing the order of displaying product information to match the seasons.<br />However, some items sell well regardless of the season, while others sell at unexpected times, which does not match the current display rule of changing the order.<br />Therefore, we looked into the possibility of changing the order of display to match the day's temperature instead of the season. It became necessary to survey the temperature of the purchased products at that time.<br />Since an external Web API is available for checking weather information, we plan to collect the weather information at the time of purchase and register it in the later review database.</span>

It’s very simple, but you need to use an “external Web API” to collect the information, and you need to combine the information obtained and the purchase information to register in the database.

Specific instructions will be discussed in a related article (not including the creation of a web site). Please take a look!

 As for the "external Web API" that we are using this time, we are using <a href="https://openweathermap.org/" target="_blank">OpenWeather</a>'s <a href="https://openweathermap.org/current" target="_blank">Current weather data</a>.

(If you want to try it out, you need to register an account and get an <a href="https://home.openweathermap.org/api_keys" target="_blank">API ID</a>).

The following is the result of a GET request from a REST client (we will run this in the mechanism we will implement in Interoperability).


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5mgceo51vnbgvewwjt6.png)

The JSON of the HTTP response is as follows:

```json
{
    "coord": {
        "lon": 135.5022,
        "lat": 34.6937
    },
    "weather": [
        {
            "id": 803,
            "main": "Clouds",
            "description": "broken clouds",
            "icon": "04d"
        }
    ],
    "base": "stations",
    "main": {
        "temp": 17.05,
        "feels_like": 13.33,
        "temp_min": 16,
        "temp_max": 18,
        "pressure": 1017,
        "humidity": 55
    },
    "visibility": 10000,
    "wind": {
        "speed": 4.63,
        "deg": 70
    },
    "clouds": {
        "all": 75
    },
    "dt": 1611635756,
    "sys": {
        "type": 1,
        "id": 8032,
        "country": "JP",
        "sunrise": 1611612020,
        "sunset": 1611649221
    },
    "timezone": 32400,
    "id": 1853909,
    "name": "Osaka",
    "cod": 200
}
```

In the <a href="https://community.intersystems.com/post/intersystems-iris-first-time-interoperability-lets-learn-how-it-works" target="_blank">next article</a>, we will discuss how the Interoperability menu works for system integration.

<!-- Links -->
[OpenWeather]: https://openweathermap.org/