Search

Clear filter
Article
Mihoko Iijima · Mar 5, 2021

[InterSystems IRIS for the First Time] Interoperability: Creating Components (Business Operation)

**This article is a continuation of this post.** In the previous article, we reviewed how to create and define messages used to send and receive data between components. In this article, I will explain how to create a business operation from the component creation methods. * Production * Message(previous article) * **Components** * Business Services * Business Processes * **Business Operations** We will quickly check the code by referring to the sample.。 ![image](/sites/default/files/inline/images/image1129jp.png) | Component Name | Role | |---|---| | Start.FileBS | A business service that uses file inbound adapter to read files placed in a specified directory at regular intervals. | | Start.NonAdapterBS | Business services that allow applications and users to input information directly without using an adapter. | | Start.WS.WebServiceBS | Business services that allow people to enter information using web services. | | Start.WeatherCheckProcess | A business process that controls the procedure for acquiring weather information and then registering it in a database. | | Start.GetKionOperation | Business operation to pass the city name to the web service that provides weather information and sent back. | | Start.SQLInsertOperation | Business operations using SQL outbound adapters to request registration of weather and purchase information into the database. | | Start.InsertOperation | Business operations that perform updates to tables in InterSystems IRIS without the use of adapters. | Note: BS stands for Business Services, BP for Business Processes, and BO for Business Operations. You need to write ObjectScript in Business Services and Business Operations and can be created in VSCode or Studio. Business Processes can also be made in the Management Portal (see this article for more information on using VSCode). There is no particular order of creation, but the external site to be connected to is a public site and can be used immediately in this sample. In this case, it is convenient to start with the business operation to make testing easier. After creating the components, there are test page in the production for business processes and business operations. However, testing is disabled by default in the production definition to avoid random testing in the production environment. For details on how to allow "Testing Enables" in Production, use the following settings (the sample Production has been set to "Testing Enabled" in advance): ![image](/sites/default/files/inline/images/image1080jp.png) ### 1) Business Operations In the sample, two types of business operations are provided. One operation is to pass the city’s name to an external Web API via REST and request the acquisition of weather information. The other operation is to give the weather information and the name of the purchased product to the InterSystems IRIS database and ask for the update process. #### 1)-1 REST Business Operations Let’s start by creating an operation that calls an external Web API via REST. This operation starts the GetKion() method when a Start.Request message is entered, queries an external site, and returns the weather information in a Start.Response message. See here for code details. To create a business operation for REST, inherit from **EnsLib.REST.Operation** . ```objectscript Class Start.GetKionOperation Extends EnsLib.REST.Operation ``` Inheritance of this class provides the following methods in IRIS that match the HTTP methods. Please refer to the documentation for details. GetURL()— used for HTTP GET operations. PostURL()— used in HTTP POST operations. PutURL()— used in a HTTP PUT operations. DeleteURL()— used in a HTTP DELETE operations. For REST, use the adapter **EnsLib.HTTP.OutboundAdapter**. Set the adapter name to the **ADAPTER** parameter and the Adapter property, as shown in the example. The INVOCATION parameter configures the **Queue**. ```objectscript Parameter ADAPTER = "EnsLib.HTTP.OutboundAdapter"; Property Adapter As EnsLib.HTTP.OutboundAdapter; Parameter INVOCATION = "Queue"; ``` It is necessary to specify the OpenWeather API key to be obtained at runtime. There is a way to display settings that vary depending on the environment in the production settings. The procedure is as follows: 1. Define the properties 2. Specify the name of the property you created in the SETTINGS parameter (if there are multiple properties, separate them with commas). Optionally, you can also specify a category (use “property name: category name”). An example code is shown below. ```objectscript /// APIキーを指定します Property appid As %String; /// specify lang option for OpenWeather API (default = ja = japanese) Property lang As %String [ InitialExpression = "ja" ]; Parameter SETTINGS = "lang:OpenWeatherMap,appid:OpenWeatherMap"; ``` The Production Settings page displays the following. The description in the line immediately before the property definition is also displayed in the production settings page, as shown in the figure. ![image](/sites/default/files/inline/images/image1084jp.png) Then, we will review the message map, which is an essential setting for business operations. ![](https://jp.community.intersystems.com/sites/default/files/inline/images/images/image(1085).png) The above definition is defined so that the GetKion() method will work when the **Start.Request message** is **sent**. In the GetKion() method, the city name can be obtained from the request message’s Area property passed as input information. By setting the city name as a parameter of the URL published by the external Web API and calling it, you can obtain weather information. The HTTP server and URL settings are configured in the Production page of the Management Portal. To obtain the settings, use the **Adapter** property provided by the HTTP outbound adapter. Example) to specify a URL, use ..Adapter.URL Use the GetURL() method provided by Business Operations for REST to call an external site. The first parameter is the URL to be executed (i.e., the URL specified in the required parameters such as city name). The second parameter is the HTTP response with parameters passed by reference. Since the weather information is stored in JSON format in the HTTP response, the operation is complete when the data is registered in the response message (=pResponse). ![image](/sites/default/files/inline/images/image1086jp.png) The response message class’s name is specified in the second parameter of the created method by passing reference. ```objectscript Method GetKion(pRequest As Start.Request, Output pResponse As Start.Response) As %Status ``` To return a response message to the caller, create an instance of the response message, store it in the second parameter variable (_**pResponse**_), and set the necessary information in the properties. ```objectscript set pResponse.AreaDescription=weatherinfo.weather.%Get(0).description set pResponse.KionMax=weatherinfo.main."temp_max" set pResponse.KionMin=weatherinfo.main."temp_min" set pResponse.Area=weatherinfo.name // this code is fit to Japan time because weatherinfo.dt is UTC set unixEpochFormat=weatherinfo.dt+32400 set dt=$system.SQL.Functions.DATEADD("s",unixEpochFormat,"1970-01-01 00:00:00") set pResponse.AreaPublicTime=dt ``` Since HTTP responses from external sites are returned in JSON format, the stream that could be obtained from the HTTP response is used to convert it into a dynamic object that is convenient for JSON operations within IRIS. ```objectscript set weatherinfo={}.%FromJSON(tHttpResponse.Data) ``` An example of a returned JSON string is shown below: ```json { "coord": { "lon": 135.5022, "lat": 34.6937 }, "weather": [ { "id": 803, "main": "Clouds", "description": "broken clouds", "icon": "04d" } ], "base": "stations", "main": { "temp": 11.38, "feels_like": 8.33, "temp_min": 11, "temp_max": 12.22, "pressure": 1007, "humidity": 62 }, "visibility": 10000, "wind": { "speed": 2.57, "deg": 220 }, "clouds": { "all": 75 }, "dt": 1611820991, "sys": { "type": 1, "id": 8032, "country": "JP", "sunrise": 1611784750, "sunset": 1611822143 }, "timezone": 32400, "id": 1853909, "name": "Osaka", "cod": 200 } ``` The maximum temperature, minimum temperature, and weather can be obtained as follows: ```objectscript set pResponse.AreaDescription=weatherinfo.weather.%Get(0).description set pResponse.KionMax=weatherinfo.main."temp_max" set pResponse.KionMin=weatherinfo.main."temp_min" ``` If you would like to learn more about JSON manipulation in IRIS, please refer to this article and documentation. Now, let’s use the production testing tool to see if we can get the weather information properly. Open the Production page (**Management Portal> Interoperability> Configuration> Production**), click Start.GetKionOperation, and then click the **"Test" button** on the "**Action**" tab. Specify a city name (Naha, Sapporo, Nagano, Shinjuku, etc.) for **Area**, and click the “**Run Test Service**” button. You can see the test results below, with the maximum and minimum temperatures and the weather listed. ![image](/sites/default/files/inline/images/image1089jp.png) Continue to learn how to use the Trace page. ![image](/sites/default/files/inline/images/image1090jp.png) Selecting a horizontal rectangle such as ![image](/sites/default/files/inline/images/image1093jp.png) in the left screen causes the information, in the right screen, to change. Messages sent and received during the system integration process are automatically saved in the database. Using the message Visual Trace page, you can see in detail what messages were passed to which components in chronological order and whether there was a response or not. Besides, if an error occurs, “An error occurred while sending/receiving/receiving □ message to the component from ○ to △.” a red mark will appear where the error occurred so that you can see it. Of course, in addition to tracing, we also have an event log page. **(Management Portal > [Interoperability] > [View] > [Event Log])** Moving on, let’s check out the operation to request an update to the database. #### 1)-2 Business operations that request updates to the database The sample provides two types of operations: Start.SQLInsertOperation and Start.InsertOperation. Each of them is an operation to request a database update, but Start.SQLInsertOperation uses the SQL outbound adapter, while Start.InsertOperation has no adapter. The difference between the two is, operation using the SQL outbound adapter is assumed to be accessed via ODBC/JDBC connections so that the database connection destination can be switched in the production settings. For operations that do not use adapters, it is assumed that the DB update target is a database within the range of visibility from the production configuration and that no connection destination switching occurs. The IRIS database can be used to store arbitrary data during system integration. However, suppose the system configuration changes for some reason a few years later, and the need to connect to a database on a different server arises. In that case, the operation without the adapter cannot be continued. On the other hand, operations using the SQL outbound adapter can be operated if there are no changes processing the content of the destination specification (if there is no problem with the SQL statement to be executed, it can be connected to databases of different products). During system integration, there may be cases where connection information changes due to external system reasons. Therefore it is vital to have a design that can flexibly respond to changes. For this reason, it is recommended to create components that support external connections in a loosely coupled manner. However, suppose there is no change in the configuration in the future. In that case, you can access the database in IRIS without using the ODBC/JDBC connection, so you can choose to use the adapter or not, depending on your usage. Let’s take a look at the Start.SQLInsertOperation code that uses the adapter. The adapter used in the sample is an SQL outbound adapter, which allows you to request the database to execute SQL statements. Different adapters provide different methods. Please refer to the documentation for details on the methods provided by the adapters. ![image](/sites/default/files/inline/images/image1094jp.png) Then review the code for Start.InsertOperation, without using the adapter. Whether you use an adapter or not, the message map and method definitions for the operation are required. If you do not use an adapter, you do not need to define the “Paramter” and “Property” for the adapter. ![](https://jp.community.intersystems.com/sites/default/files/inline/images/images/image(1096).png) Business operations without adapters: In Start.InsertOperation, SQL is executed using ObjectScript (the comment statement is the update process in object operations). The implementation is satisfactory if the database to be updated is not detached from IRIS. We found out that operations using adapters provide a reliable method to request processing from the destination. We also confirmed that it is possible to create operations without using adapters and freely write code for them. Next, I would like to explain how to create a business process that calls the operations for getting weather information and updating the database in the correct order.
Announcement
Anastasia Dyubaylo · Jan 20, 2021

Webinar in Spanish: Developing a chatbot with Google Dialogflow, Telegram and InterSystems IRIS

Hi Community, We are pleased to invite you to the upcoming webinar in Spanish: ➡️ Developing a chatbot with Google Dialogflow, Telegram and InterSystems IRIS Date & Time: February 2, 4:00 PM (CET) During the webinar: you will learn how to develop a chatbot that will permit users to interact with an appointment system. We will coordinate the appointment system's backend and the Google Dialogflow and Telegram services with InterSystems IRIS. you will know how to consider adding a chatbot to help users to use your services in a smarter way. we will go over the required concepts to implement a chatbot, what is needed and how you can coordinate the external services. Speaker: @Alberto.Fuentes, Sales Engineer, InterSystems Iberia Note: The language of the webinar is Spanish. We are waiting for you at our webinar! ➡️ Please register here!
Announcement
Anastasia Dyubaylo · May 4, 2021

New Video: Package First Development Approach with InterSystems IRIS and ZPM

Hi Developers, Enjoy watching this new video presented by @Evgeny.Shvarov: ⏯ Package First Development Approach with InterSystems IRIS and ZPM A demo of package first development approach with InterSystems IRIS and ZPM Package manager. Develop the code as it is already deployed. ⬇️ ObjectScript Package Manager on Open Exchange ➡️ Join ZPM discussion in our Discord ✅ Follow DC ZMP tag to be up to date with the latest post on ZMP Stay tuned!
Question
Sudarshan Chandrashekar · Oct 4, 2021

How to migrate InterSystems Cache products to the AWS / other public clouds?

Folks, I am looking to migrate a few legacy debt collection applications built using InterSystems Cache to AWS. Does anyone here have any experience, ideas and best practices on migrating Cache products to the public cloud? Regards Sudarshan +1-917-685-3551 AWS offers EC2, and it will be just virtual machines. And it will be possible to migrate any of your instances quite easy, if you would choose the same environment. If you have windows on your server, you can have Windows there as well. It's the easiest way. You would need to install the same version of the InterSystems platform you use, and repeat the configuration, copy necessary information and that's it. But for sure, could be some other options. But AWS also suppose support for containers, this could be more difficult. And the best would be if you would use IRIS. I can help with this migration if you wish.
Announcement
Anastasia Dyubaylo · Oct 19, 2021

Virtual Summit'21: Win. Win. Win with InterSystems Developer Ecosystem

Hey Developers, Planning to attend the Focus Sessions of InterSystems Virtual Summit 2021? Don't miss the session dedicated to InterSystems Developer Community, Open Exchange & Global Masters! ⚡️ "Win. Win. Win with InterSystems Developer Ecosystem" VSummit21 session ⚡️ 🎁 Note: All session attendees get a special prize. Speakers: 🗣 @Anastasia.Dyubaylo, Community Manager, InterSystems 🗣 @Lena.Evsikova, Product Owner of InterSystems Open Exchange🗣 @Olga.Zavrazhnova2637, Customer Advocacy Manager, InterSystems Learn how to succeed with the InterSystems Developer Community, Global Masters gamification hub, and Open Exchange application gallery. Interests: Developer Experience, InterSystems IRIS, User Communities Our Focus Sessions are available on-demand for viewing from Wednesday, October 27! So! Join our session to enjoy the full experience of InterSystems Technology and our Ecosystem for Developers! Looking forward to it!! I will be there! @Olga.Zavrazhnova2637@Lena.Evsikova @Anastasia.Dyubaylo Just watched your presentation. It was really GREAT !!You raised the level of presentation significantly.The most attractive presentation for me so far.It will be hard to top you.CONGRATULATIONS ! So happy to hear that, Robert! Thank you! I completely agree with @Robert.Cemper1003! Great job highlighting the D.C., OEX and Global Masters!! Thank you, Robert! So happy to hear such feedback 😊 Thank you, Ben ☺️ Very good presentation. They are a true trio of pocker aces to win And all the crew that are in the same ship
Announcement
Anastasia Dyubaylo · Dec 15, 2021

Video: Partner Directory New Services for InterSystems Partners & End Users

Hey Developers, Learn about the InterSystems Partner Directory, its value to partners, and how to join: ⏯ Partner Directory New Services for InterSystems Partners & End Users 🗣 Presenter: Elizabeth Zaylor, Partnerships & Alliances, InterSystems See you at https://partner.intersystems.com!
Announcement
Olga Zavrazhnova · Dec 5, 2021

Global Masters needs your votes! Help InterSystems Community to Win!

Hey Community, This is the time to show our passion for the InterSystems Developer Community! We're so proud to announce that InterSystems Global Masters is a finalist for an Influitive BAMMIE Award for Most Passionate Community🤩🤩🤩 Certainly, this is because of you, our great community members! BUT, for us to win, we'll need to get more votes than other finalists - so we need your votes! 🚀 PLEASE press "You've got my vote" > in this challenge < Vote every day till December 9 to show that we have the most engaged community! Let's WIN together! 3-days left! Video from Olga :) Hey Community, only 3 days are left to vote for Global Masters! Community! We really need your support!!! Please vote for us 🙏🏼 Vote Community! Vote, please! We have to support our dev community! Today is the last voting day! Please press the button for us in this challenge https://globalmasters.intersystems.com/challenges/2982Thank you, Community, for support! Fingers crossed!
Article
Botai Zhang · Jan 25, 2021

Built in multi model integration using InterSystems iris data platform

Built in multi model integration using InterSystems iris data platform Solution of hospital information inquiry business Integration of hospital information query business solutions using InterSystems IRIS data platform with built-in multiple models ### Summary: With the gradual improvement of hospital information construction, there are more and more hospital subsystems, and more and more interfaces between systems. At the same time, the interface cost is increasing, and the management work is becoming more and more complex. Among them, the number of query business interfaces is gradually increasing according to the business type differentiation, which brings problems such as large amount of interfaces, heavy development work, code redundancy, difficult maintenance and so on. In view of this dilemma, we use InterSystems IRIS data platform built-in multi model integration of hospital information query business solutions. The application can be configured to complete the query business interface implementation, greatly reducing the key operation cycle of development, maintenance, implementation and other projects.Key applications: IRIS, Rest API, ObjectScript, Globals, SQL, data lookup tables ### Application model and Application Introduction: 1. Using the model 1. Globals (key-value) Globals is a sparse multidimensional array that can be stored and managed in IRIS database. You can use ObjectScript and native APIs to work with globals. **Tools:** https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GGBL_MANAGING **Application:** According to the key value pair of globals, the application program has the characteristics of fast access speed. It is applied in the rest dispatch class and BP process management of this program, which solves the problem of frequent value taking, slow speed and configuration operation on the front page of the lookup table, such as storing SQL model, service configuration information and so on. 2. SQL access InterSystems iris provides SQL access to data through ObjectScript, rest API and JDBC **Tools:** https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GSQL_smp **Application:** In the query business, the three-party system does not cooperate with the interface transformation, which leads to the difficulty of interface implementation. At this time, we use iris embedded model ObjectScript, rest API and JDBC to realize SQL access to data and establish business interface. 3. Object access Through ObjectScript and rest API, InterSystems iris provides a way to store and change object instances in globals. **File:** https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=PAGE_multimodel_object **Application:** During the whole interaction process, the InterSystems iris object is manipulated directly. ObjectScript class definitions are often used as templates for creating objects such as patients, departments, or healthcare workers. 2. Establish application cases (this application takes patients as an example) 1. application construction: 1. basic environment Iris version information: iris for windows (x86-64) 2020.1 (build 215u) mon Mar 30 2020 20:14:33 EDT \[Health Connect:2.1.0] Iris has java and JDBC environment Postman can be used for testing 2. installation steps ① Establish rest Service New web application → configure dispatch class → configure permission. This step can be seen in the following pictures: application running / webreplication (query). PNG and webreplication (role). PNG ② Configure sql-jdbc Establish SQL connection, connect to test database mysql, import test jhip_ patient_ info.sql ③ Configuration lookup table Global-^ Ens.LookupTable Look up table file import in ④ Import code Import the code in applicationcode, compile and open production, Note: modify Bo configuration information (DNS), configure Java gateway, etc 2. application process Omitted (see PDF) 3. Application Test The postman tool (or other tools) can be used for test verification Postman can import Query.postman_ collection.json , change IP, port number information and URL for testing. 4. application summary This application takes patient service query as a case, which can be configured with inbound and outbound protocols, query conditions and business types to solve the problem of query business interface. Finally, if you agree with this solution, please vote for the application in the inter systems multi model database contest. Voting links Application name:HealthInfoQueryLayer Thank you very much for your support!
Announcement
Anastasia Dyubaylo · Mar 4, 2021

New Video: Getting Started with the InterSystems IRIS FHIR Server on AWS

Hey Developers, See how the InterSystems IRIS FHIR Server allows you to develop and deploy your FHIR applications on AWS without manual configuration and deployment: ⏯ Getting Started with the InterSystems IRIS FHIR Server on AWS 👉🏼 Subscribe to InterSystems Developers YouTube. Enjoy and stay tuned!
Article
Yuri Marx · Dec 21, 2020

Do NLP in any website with InterSystems IRIS and Crawler4J

Today, is important analyze the content into portals and websites to get informed, analyze the concorrents, analyze trends, the richness and scope of content of websites. To do this, you can alocate people to read thousand of pages and spend much money or use a crawler to extract website content and execute NLP on it. You will get all necessary insights to analyze and make precise decisions in a few minutes. Gartner defines web crawler as: "A piece of software (also called a spider) designed to follow hyperlinks to their completion and to return to previously visited Internet addresses". There are many web crawlers to extract all relevant website content. In this article I present to you Crawler4J. It is the most used software to extract website content and has MIT license. Crawler4J needs only the root URL, the depth (how many child sites will be visited) and total pages (if you want limit the pages extracted). By default only textual content will be extracted, but you config the engine to extract all website files! I created a PEX Java service to allows you using an IRIS production to extract the textual content to any website. the content is stored into a local folder and the IRIS NLP reads these files and show to you all text analytics insights! To see it in action follow these procedures: 1 - Go to https://openexchange.intersystems.com/package/website-analyzer and click Download button to see app github repository. 2 - Create a local folder in your machine and execute: https://github.com/yurimarx/website-analyzer.git. 3 - Go to the project directory: cd website-analyzer. 4 - Execute: docker-compose build (wait some minutes) 5 - Execute: docker-compose up -d 6 - Open your local InterSystems IRIS: http://localhost:52773/csp/sys/UtilHome.csp (user _SYSTEM and password SYS) 7 - Open the production and start it: http://localhost:52773/csp/irisapp/EnsPortal.ProductionConfig.zen?PRODUCTION=dc.WebsiteAnalyzer.WebsiteAnalyzerProduction 8 - Now, go to your browser to initiate a crawler: http://localhost:9980?Website=https://www.intersystems.com/ (to analyze intersystems site, any URL can be used) 9 - Wait between 40 and 60 seconds. A message you be returned (extracted with success). See above sample. 10 - Now go to Text Analytics to analyze the content extracted: http://localhost:52773/csp/IRISAPP/_iKnow.UI.KnowledgePortal.zen?$NAMESPACE=IRISAPP&domain=1 11 - Return to the production and see Depth and TotalPages parameters, increase the values if you want extract more content. Change Depth to analyze sub links and change TotalPages to analyze more pages. 12 - Enjoy! And if you liked, vote (https://openexchange.intersystems.com/contest/current) in my app: website-analyzer I will write a part 2 with implementations details, but all source code is available in Github. Hi Yuri!Very interesting app!But as I am not a developer, could you please tell more about the results the analizer will give to a marketer or a website owner? Which insights could be extracted form the analysis? Hi @Elena.E I published a new article about marketing and this app: https://community.intersystems.com/post/marketing-analysis-intersystems-website-using-website-analyzer About the possible results allows you: 1. Get the most popular words, terms and sentences wrote into the website, so you discover the business focus, editorial line and marketing topics. 2. Sentiment analysis into the sentences, the content is has positive or negative focus 3. Rich cloud words to all the website. Rich because is a semantic analysis, with links between words and sentences 4. Dominance and frequence analysis, to analyze trends 5. Connections paths between sentences, to analyze depth and coverage about editorial topics 6. Search engine of topics covered, the website discuss a topic? How many times do this? 7. Product analysis, the app segment product names and link the all other analysis, so you can know if the website says about your product and Services and the frequency Hi Yuri! This is a fantastic app! And works! But the way to set up the crawler is not that convenient and not very user-friendly. You never know if the crawler works and if you placed the URL right. Is it possible to add a page which will let you place the URL, start/stop crawler and display some progress if any? Maybe I ask a lot :) Anyway, this is a really great tool to perform IRIS NLP vs ANY site:
Announcement
Anastasia Dyubaylo · Dec 12, 2020

New Video: InterSystems IRIS Native Python API in AWS Lambda

Hey Developers, Please welcome the new video by @sween on InterSystems Developers YouTube: ⏯ InterSystems IRIS Native Python API in AWS Lambda In this video, you will learn the seamless InterSystems IRIS functionality in the AWS Serverless ecosystem. Leave your questions in the comments to this post. Enjoy and stay tuned!
Announcement
Olga Zavrazhnova · Dec 14, 2020

Review InterSystems IRIS on TrustRadius and get $25 VISA Card

Hi Developers, We invite you to take a few minutes and leave a review about your experience with InterSystems IRIS on the TrustRadius. Submitting a review requires time and effort, so we'll be glad to reward you with a $25 VISA Gift Card for a published review! UPDATE: this promotion ended in 2021. To get a $25 VISA card from InterSystems follow these steps: ✅ #1: Follow → this link ← to submit a review (click on the "Start My Review" button). ✅ #2: Your review will have a title (headline). Copy the text of the headline of your review and paste it in this challenge on Global Masters. ✅ #3: After your review is published you will get the $25 VISA Cards and 3000 points on Global Masters. Please note: TrustRadius must approve the survey to qualify for the gift card. TrustRadius will not approve reviews from resellers, systems integrators, or MSP/ISV’s of InterSystems. TrustRadius does not approve the reviews that have been previously published online. Done? Awesome! Your gift card is on the way! Hmm. The link to GM says: Ooops! Sorry friend, looks like this challenge is no longer available. My title: " Never say IMPOSSIBLE with IRIS " Hi Robert, thank you for submitting a review for us! I made some corrections to the challenge, so the link should work for you now. THX. Just verified it. Hi, the GM link is broken. It says: Ooops! Sorry friend, looks like this challenge is no longer available. here it is:https://www.trustradius.com/reviews/intersystems-iris-2020-12-15-16-53-48 Hi Akshay,I see you registered recently - welcome to Global Masters! Could you please complete this challenge first? After it's done the TrustRadius challenge will be unlocked for you. Thank you, Robert! Your gift card is already opened for you on GM Thanks for your help. Here's the published review! https://www.trustradius.com/reviews/intersystems-iris-2020-12-23-14-00-04 Hi Akshay! So great, thank you! Your reward is opened for you on Global Masters. Happy New Year! There seems to be some error. I clicked on Redeem, and my card just disappeared. It is not showing in the Rewards section either! That's the way it works. You consume it once.You'll get a mail once processed. But probably not this year Ah no issues, I'll wait until next year. I've got nothing but time. Thanks though!! I can't see any challenges... What do I do now? Great Unable to paste in challenge on Global Master
Article
Mihoko Iijima · Mar 5, 2021

[InterSystems IRIS for the First Time] Interoperability: Creating Components (Business Services)

**This article is a continuation of this post.** In the previous article, we discussed the development of business processes, which are part of the components required for system integration and serve as a production coordinator. This article will discuss creating a business service, which is the information input window for production. * Production * Message * **Components** * **Business services** * Business processes(previous post) * Business operation And finally, the last component of “Let's Use Interoperability!” The business service provides a window of input for information sent from outside IRIS, with or without using the adapter for external I/F. There are three types of business services in the sample (links in parentheses are links to the sample code): 1. [Business services for files using inbound adapters](#fileinboundadapter)(Start.FileBS) 2. [Business services for Web services using the SOAP inbound adapter](#soapinboundadapter)(Start.WS.WebServiceBS) 3. [Business service called by stored procedure or REST without using an adapter](#nonadapter)(Start.NonAdapterBS) Different connection methods used for inputting information will only increase the number of business services; however, the processing done within a business service is Create a request message to be sentusing externally inputted information and simply call the business component It's effortless. Now, let's outline how to create components that use file-inbound adapters. Business services are written in scripts, which can be created in VSCode or Studio (see this article on using VSCode). ### 1. Business services for files using inbound adapters(Start.FileBS) If you create a class in VSCode, you should create a class that inherits from Ens.BusinessService. As for adapters, you can use the **ADAPTER** parameter as ADAPTER class name (e.g., specify a file-inbound adapter class). If you do not use the adapter, no configuration is required. ```objectscript Class Start.FileBS Extends Ens.BusinessService { Parameter ADAPTER = "EnsLib.File.InboundAdapter"; ``` In the file-inbound adapter, you can specify the directory to be monitored in Settings→File Path for the production's business service. ![image](/sites/default/files/inline/images/image1114_0.png) If the file located in the "File Path" matches the information specified in the "File Spec," it opens the file as a stream object. It defines it as the first variable when calling the business service **ProcessInput()**. When **ProcessInput()** is started, **OnProcessInput()** is automatically called. OnProcessInput() is passed directly to **OnProcessInput()** with the parameters passed to ProcessInput(). ![image](/sites/default/files/inline/images/image1111.png) In **OnProcessInput()** the initial statement gets the information from the file stream object, which is passed as the first parameter, then creates a message to be given to the next component, writes the process of calling the next component, and completes the basic logic. * * * 【Memo】For Studio, launch the Business Services Wizard in the New Creation menu, select the adapter and press the Finish button. * * * The **OnProcessInput()** method definition is as follows: ```objectscript Method OnProcessInput(pInput As %Stream.Object, Output pOutput As %RegisteredObject) As %Status ``` **pInput** is provided with an instance of the **%Stream.FileCharacter** class for text files or the **%Stream.FileBinary** class for binary files. In the sample, a file in text format will be inputted, and we have written it to accept multi-line requests and one request per line. **AtEnd property** is set to 1 when EndOfFile is deteced. You can use this property to stop loop. In a loop, we read the lines using the **ReadLine()** method, which enables us to obtain information about the contents of the file one line at a time (see the documentation for file adapter details). Compose the message, retrieving information line by line. Then, we execute the ..SendRequestAsync() method, which calls the other components. When executing the method, the first parameter should be the name of the component you want to call as a string, and the second parameter should be the request message you have created. Note that the ..SendRequestAsync() is an asynchronous call and does not wait for a response. Memo:There is also SendRequestSync() for synchronous calls.。 The sample code is as follows: ![image](/sites/default/files/inline/images/image1112-1.png) Reference:explanation of the usage of the $piece() function in the above example text $piece(“string”, ”delimiter mark”, ”position number”) The function to set/get a string with a delimiter, in the sample, to get the first and second value of comma-separated data, is written with the following syntax: ```objectscript set request.Product=$piece(record,",",1) set request.Area=$piece(record,",",2) ``` Now, let's check the function of Start.FileBS as it appeared in the above description. In the sample production, the "File Path" was set to **/irisdev/src**, and the "File Spec" was set to **check.txt**. Either prepare the same directory or change it to a different directory and register the sample data in the check.txt file using the following format: purchased product name, name of the city. ※If you are using the sample container, please rename [Test-check.txt] in the src directory under the directory created by the git clone. ![image](/sites/default/files/inline/images/image1112.png) ![image](/sites/default/files/inline/images/image1113.png) ### 2. Business services for Web services using the SOAP inbound adapter (Start.WS.WebServiceBS) Next, we will outline the creation of business services for Web services. The Business Service Class for Web Services acts as a Web Service Provider = Web Service Server. In the sample, we have two parameters in the Web service method for this sample production to have information sent from the Web service client. The web method uses the data entered in the parameters to create a message class and call other components. ![image](/sites/default/files/inline/images/image1115.png) When you define a Web service class, a test screen is created. However, it is not shown by default. Log in to IRIS (or start a terminal), go to the namespace where the production is located and do the following: For your reference:Access to the Catalog and Test Pages Here is a sample code configuration in the setting where the container was started with docker-compose up -d (run in the %SYS namespace) set $namespace="%SYS" set ^SYS("Security","CSP","AllowClass","/csp/user/","%SOAP.WebServiceInfo")=1 set ^SYS("Security","CSP","AllowClass","/csp/user/","%SOAP.WebServiceInvoke")=1 【Attention】Please note that the sentence is case-sensitive and should be written with care. Also, depending on the namespace in which the product is used, the specified script changes. The example sentence is written on the assumption that the sample is imported into the USER namespace.If you import the sample code into the ABC namespace, the fourth subscript should be "/csp/abc/." Once the configuration is complete, go to the following URL: http://localhost:52773/csp/user/Start.WS.WebServiceBS.cls ![image](/sites/default/files/inline/images/image1116.png) If you want to provide the WSDL to your Web services client, specify WSDL=1 at the end of the following URL http://localhost:52773/csp/user/Start.WS.WebServiceBS.cls?WSDL ### 3. Business services called by stored procedures or REST without using adapters(Start.NonAdapterBS) Next, we will introduce the Business Service without adapters (Start.NonAdapterBS). ![image](/sites/default/files/inline/images/image1117.png) For business services that use adapters, the adapter calls the business service's ProcessInput() method to detect the information. If you don't use adapters, you can still call the ProcessInput() method, but this method is not public. Therefore, if you implement a business service that does not use adapters, you will need to consider ProcessInput(). The sample utilizes the following two methods: * Stored procedures(Start.Utils) * Dispatch Class for REST(Start.REST)→This is the service we ran in this article. Now, here's an example of a stored procedure. ![image](/sites/default/files/inline/images/image1118-1.png) After adding a business service (Start.NonAdapterBS) that does not use adapters to the production (state added in the sample), run the following stored procedure call Start.Utils_CallProduction('piroshki','Russia') ![image](/sites/default/files/inline/images/image1119.png) A resulting trace of the running result is as follows: ![image](/sites/default/files/inline/images/image1120.png) Next, here is an example of creating a dispatch class for REST: ![image](/sites/default/files/inline/images/image1123_0.png) The XML described in the XData Url Map defines which methods are called in response to the URL at the time of the REST call. The example describes a definition that calls the **WeatherCheck()** method when the URL of the **/weather/first parameter (purchased product name)/ second parameter (name of the city)** are provided in the **GET request**. ```objectscript ``` Then, define the base URL for the above URL in the Management Portal's Web Application Path Settings screen, and it is complete. See this article for more details on the configuration. Once it is ready, try to run the information using a business service that allows you to send the REST information. Example)http://localhost:52773/start/weather/Takoyaki/Osaka ![image](/sites/default/files/inline/images/image1124.png) ![image](/sites/default/files/inline/images/image1125.png) If you do not use an adapter, as ProcessInput() cannot be called directly from outside, we have created an object for the business service in the logic executed through REST or stored procedures (using the CreateBusinessService() method of the Ens.Director class) and called ProcessInput() If you use an adapter, the adapter detects the input and stores the information in a unique object and passes it to the business service. In contrast, if you don't use an adapter, the rest is pretty much the same, only the difference is in the above-mentioned part of the process. The business service is simply designed to use the information entered outside IRIS to create request messages and call business components. Throughout the sample production, we were able to see the following: Different components play different roles in making a production run (business services, business processes, business operations). To transmit information between components, use the message. Messages are stored in the database unless deleted and thus can be traced at any time. Some adapters simplify the process of around the connection. These are the basic operations on how to use Interoperability in IRIS. There are also record maps (see: FAQ TOPIC) and data conversion tools that are useful for input and output of CSV files and other format-specific files. As well as this series, there is also an article on simple IoT applications developed with InterSystems IRIS using Interoperability. Please check it out. Besides, IRIS for Health also supports FHIR and HL7 (including SS-MIX2) transmissions. I would be pleased to explain it in another post. If you have something of interest to share, please leave a comment! Finally, training courses are also available to learn how to use Interoperability. If you'd like to take the time to try it out with an instructor, please consider joining one of our training courses!
Announcement
Anastasia Dyubaylo · Mar 19, 2021

New Video: Deploying InterSystems IRIS Solutions into Kubernetes Google Cloud

Hi Community, Please welcome the new video on InterSystems Developers YouTube: ⏯ Deploying InterSystems IRIS Solutions into Kubernetes Google Cloud See how an InterSystems IRIS data platform application is deployed into a Kubernetes cluster, specifically on Google Kubernetes Engine (GKE), using Terraform to create a cluster and a CI/CD GitHub implementation called GitHub Actions to automate deployment steps. ⬇️ Access all code samples here. 🗣 Presenter: @Mikhail.Khomenko, DevOps Engineer Additional materials to this video you can find in this InterSystems Online Learning Course. Enjoy watching this video! 👍🏼
Article
Evgeny Shvarov · Jun 24, 2020

Getting an Angular UI for your InterSystems IRIS application in 5 minutes

Hi Developers! Suppose you have a persistent class with data and you want to have a simple Angular UI for it to view the data and make CRUD operations. Recently @Alberto.Fuentes described how to build Angular UI for your InterSystems IRIS application using RESTForms2. In this article, I want to tell you how you can get a simple Angular UI to CRUD and view your InterSystems IRIS class data automatically in less than 5 minutes. Let's go! To make this happen you need: 1. InterSystems IRIS 2. ZPM 3. RESTForms2 and RESTForms2-UI modules. I'll take a Data.Countries class which I generated and imported via csvgen using this command: d ##class(community.csvgen).GenerateFromURL("https://raw.githubusercontent.com/datasciencedojo/datasets/master/WorldDBTables/CountryTable.csv",",","Data.Countries" To make an Angular UI we need to expose REST API for this class, which will service CRUD operations. Let's use restforms2 module for this. This command in dockerfile installs restforms2 into IRIS container: zpm "install restforms2" \ To add a REST API we need to derive the class from Form.Adaptor: Class Data.Countries Extends (%Library.Persistent, Form.Adaptor) Add restforms2 parameters to the persistent class to manage the general behavior: sorting parameter, display name, etc: // Form name, not a global key so it can be anything Parameter FORMNAME = "Countries"; /// Default permissions /// Objects of this form can be Created, Read, Updated and Deleted /// Redefine this parameter to change permissions for everyone /// Redefine checkPermission method (see Form.Security) for this class /// to add custom security based on user/roles/etc. Parameter OBJPERMISSIONS As %String = "CRUD"; /// Property used for basic information about the object /// By default getObjectDisplayName method gets its value from it Parameter DISPLAYPROPERTY As %String = "name"; Perfect. Next, we can use restforms2 syntax to let restforms2 know, what properties of the class we want to expose to the CRUD. You can make it adding "DISPLAYNAME =" attribute to the properties, you want to expose into restforms2-ui. Example: Property code As %Library.String(MAXLEN = 250) [ SqlColumnNumber = 2 ]; Property name As %Library.String(DISPLAYNAME = "Name", MAXLEN = 250) [ SqlColumnNumber = 3 ]; Property continent As %Library.String(DISPLAYNAME = "Continent", MAXLEN = 250) [ SqlColumnNumber = 4 ]; Property region As %Library.String(DISPLAYNAME = "Region", MAXLEN = 250) [ SqlColumnNumber = 5 ]; Property surfacearea As %Library.Integer(DISPLAYNAME = "Surface Area", MAXVAL = 2147483647, MINVAL = -2147483648) [ SqlColumnNumber = 6, SqlFieldName = surface_area ]; Property independenceyear As %Library.Integer(DISPLAYNAME = "Independence Year", MAXVAL = 2147483647, MINVAL = -2147483648) [ SqlColumnNumber = 7, SqlFieldName = independence_year ]; Great! Now lets introduce the UI layer. This command in dockerfile installs restforms2-ui, which is Angular UI for Restform2: zpm "install restforms2-ui" \ That's it! Let' examine the UI for your class, which you can find in the URL server:port/restforms2-ui: RESTForms goes with test classes Person and Company - and you can use it to examine the features of restformsUI. Currently It can edit string, number, boolean, date and look-up fields. You can test all this on your laptop, if clone and build this repository: docker-compose up -d --build And then open the URL: localhost:port/restforms2-ui/index.html or if you use VSCode, select this menu item: Happy coding and stay tuned! It's great! I tried the application, and I liked the interface and how easy it is to create a simple CRUD using RESTForms. 💡 This article is considered as InterSystems Data Platform Best Practice. Love the accelerator concept for quick and easy CRUD :)