Interoperability QuickStart

10 minutes
estimated time of completion.

Sharing data between systems has never been easier. Consume data from multiple systems, route messages according to logic you define, and connect using common protocols and multiple languages. With the InterSystems IRIS™ data platform, you can:

  • Route messages based on metadata or message contents.
  • Apply and update business logic in a low-code UI.
  • Transform data programmatically for downstream systems.
  • Use out-of-the-box components for quick integrations or code your own for even more flexibility.
  • Act on data flowing through the system with machine learning algorithms.
  • Store consolidated data to one repository for deeper analysis.
  • Track messages to troubleshoot or audit with ease.

Cameras on traffic lights have been installed to automatically identify red light violations. This data needs to be stored in a database for further analysis. If the violator is not an emergency vehicle, the data also needs to be sent to another application to issue a ticket.

InterSystems IRIS is being used to route the data, apply business rules to determine which violations result in tickets, and automatically transform data to the appropriate format needed for the downstream systems. For this activity, you will use the InterSystems Management Portal from an instance of InterSystems IRIS to see some of the key features of interoperability.

Set up

In InterSystems IRIS, an integration solution is known as a production. A production provides built-in connections to a wide variety of message formats and communications protocols. You can easily add other formats and protocols – and define business logic and message transformations either by coding or using graphic wizards. Productions provide persistent storage of messages, which allow you to trace the path of a message and audit whether a message is successfully delivered. A production consists of business services, processes, and operations:

  • Business services connect with external systems and receive messages from them.
  • Business processes allow you to define business logic, including routing and message transformation.
  • Business operations connect with external systems and send the messages to them.

1. Import the Production

Note
If you don’t have InterSystems IRIS set up yet, get a free development sandbox here. This Production is already loaded in the sandbox, so you can skip this step!
  1. Clone the sample code from GitHub by typing the command:
    git clone https://github.com/intersystems/Samples-Integration-RedLights
  2. Locate the Management Portal, the browser-based interface for configuring InterSystems IRIS. The URL for your Management Portal depends on how you installed InterSystems IRIS. Refer to this page if you have forgotten what it is.
  3. Import the production using the Management Portal. Switch to the USER namespace on the left. Navigate to System Explorer > Classes, and import {directory where you downloaded the repo}/Samples-Integration-RedLights/data/EndStateProduction.xml.

2. Verify the Production has been started

  1. In the Management Portal, navigate to Home > Interoperability > Configure > Production and open Demo.RedLights
  2. If the box in the top left says Production Stopped or Production Suspended, start the production using the Start button.

Monitor message transport

1. View messages

  1. When the integration solution was started in Set Up, the production consumed a .txt file and processed it. Take a look at the message passed through by navigating in the Management Portal to Interoperability > USER namespace > View > Messages and selecting the top-most message that has source equal to RealTimeRedLightViolation.
  2. On the Trace tab, click View Full Trace.
  3. This opens what is known as the visual trace and allows you to see how the data is passed between InterSystems IRIS production components.
  4. All messages are stored to the database which makes troubleshooting and auditing easy.
  5. A message has been consumed by the RedLightViolation business service. Can you tell which business process the message was then sent to? Which property is not used when sending data to the To_TicketApplication business operation? (HINT: Select message [1] and click the Contents tab on the right. Then compare this to [3].)

    (ANSWER: Demo.TicketBPL and CarType, respectively.)

2. Send another message through the interface

  1. Copy {directory where you downloaded the repo}/Samples-Integration-RedLights/data/SampleFiles/LocalRedLightViolation1-copy.csv to the In folder.
  2. Unable to find it? Make sure to change the File of type drop-down to All Files (*) in the file selection dialog.

Consume CSV files using the built-in record mapper

  1. From the Message Viewer window, click Home in the upper left. Then navigate to Interoperability > Build > Record Maps and open Demo.RedLightViolationsRecordMap.
  2. The Record Map UI allows you to easily generate code to consume and produce delimited files. While this particular record map already exists, notice there is the option to select a sample file and see how data in the file will be parsed. Additionally, a CSV wizard can read headers and generate the corresponding record map on the fly.
  3. Click Select a Sample File and choose the message you previously passed in: LocalRedLightViolation1-copy.csv. This utility makes it easy to build your record map and verify files will correctly be parsed.
  4. Select in the top menu, Home > Interoperability > Configure > Production. Select the RealTimeRedLightViolation business service. In the Settings tab on the right, find the RecordMap setting and note that it is set to the record map you just viewed, RedLightViolationsRecordMap.

Each business service has configuration settings that can easily be modified while the integration system is running, only impacting the particular service you need to work on. No code had to be written for this business service to work, allowing you to quickly consume and send delimited files.

Route messages, apply business logic and transformations

Data received from traffic lights needs to be sent to the ticket application and stored in an archive for further analysis. However, a ticket should only be sent if the vehicle that ran the red light is not an authorized vehicle, such as a police car or fire truck. InterSystems IRIS can appropriately route, apply logic, and transform data to ensure this process happens smoothly.

  1. Still on the Production Configuration page, select the Demo.TicketBPL business process on the Settings tab on the right. Find Class Name setting under Informational Settings, and select the magnifying glass to open the business process. Using the low-code editor, you can easily add logic, control flow, and send messages to business operations, which ultimately send data out to other applications.
  2. Select the Check if whitelisted rule activity and open the Rule Editor using the blue button on the right. You can apply rules to modify particular aspects of how messages are processed, and set up security so certain people can only edit the rules. This allows you to easily divide tasks and provide access to the right people while keeping the rest of your application secure.
    CHALLENGE: See if you can add a new rule to also allow vehicles with CarType equal to SWAT.
  3. Go back to the Demo.TicketBPL business process. If you no longer have the tab open, you can select Home > Interoperability > Build > Business Processes > Go. Select Call To_TicketApplication. Call activities like this one can easily convert data to a format that can be used by downstream systems. Data transformations can be created, leveraging the same UI, for more advanced transformation of data, allowing you to reuse transformations throughout your applications.

While the business services and business operations in this sample production consumed data using no code, you can also write code to completely customize your own business components, letting you consume and send data in just the way you need. This allows you to use prebuilt adapters for TCP, FTP, SQL, and REST data input and output.