Hello word!
I am new in this field and i am coming from the dot net and angular world.
So hello to everyone!
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
Hello word!
I am new in this field and i am coming from the dot net and angular world.
So hello to everyone!
Hi,
When we open a terminal in IRIS, we are entering the ObjectScript shell. Within this shell, we can execute IRIS commands, such as:
In other words, the ObjectScript command is executed in the current shell. But it's always good to remember that IRIS has other shells
One very interesting aspect is shortcuts. We can access these shells through their calls or via shortcuts, as shown in the table below:
Terminal Commands for Production:
Do ##class(Ens.Director).StartProduction(“ProductionName”)
Do ##class(Ens.Director).StopProduction()
Do ##class(Ens.Director).UpdateProduction()
Do ##class(Ens.Director).RecoverProduction()
Do ##class(Ens.Director).CleanProduction()
Abort Messages in the queue:
d ##class(Ens.Queue).AbortQueue(“Component Name”)
Get InstanceName :
W !,##class(%SYS.System).GetUniqueInstanceName()
Get Node Name:
W !,##class(%SYS.System).GetNodeName()
Terminate JobId :
Hola amigo! 😊 Cómo estás hoy,
I would like to share a small part of my learnings from my first ever official project: POS/EDC machine integration with our billing system. This was an exciting challenge where I got hands-on experience working with APIs and vendors.
How does a Payment Machine actually work?
It's simple, start by initiating/creating a transaction, then retrieve its payment status.
Here, initiate/create refers to POST method and Retrieve refers to GET.
I'm pleased to announce version 2.6.0 of the VS Code ObjectScript extension, containing a number of enhancements that make a developer's life easier. Some highlights are described below. As always, find the full list of modifications in the CHANGELOG, including many bug and vulnerability fixes.
Thanks to @Olli Tanskanen at partner company JediSoft Oy for this enhancement! You can now switch namespaces from the Server Actions menu (when using client-side folders only).
Hi developers!
How do you debug implementation code in .impl classes of REST.API in InterSystems IRIS?
Especially if you don't have access to globals, so no things like:
Set^AAA="here we are"not possible in this case.

Suppose I have the following signature of the REST.API method called as POST and containing JSON. :
i am looking for a Class or Function to check if a Base64 document is valid ( will results into Full file after decoding or not ),
i was not able to find any predefined class in Objectscript ,
has anyone worked on something similar before ?
any advice will be welcomed
I would like to share with you a little trick to customize how messages are displayed in the Message Viewer. In particular, how you can display messages as JSON (instead of the default XML representation).
Messages are objects that are used to communicate interoperability productions components. In my example I have defined a message that later I serialize as JSON to send to an external API. This message is defined as a regular message and also as a %JSON.Adaptor so I can export / import directly to or from JSON.
When using a EnsLib.RecordMap.Service.FileService business service, is there a way to tell which row number that is being read in? I want to read in a csv, but on the first record, trigger a truncate on the External SQL Table that it is being written to through JDBC.
Thanks
Scott
.png)
Hi Community,
In this article, we will explore the concepts of Dynamic SQL and Embedded SQL within the context of InterSystems IRIS, provide practical examples, and examine their differences to help you understand how to leverage them in your applications.
InterSystems SQL provides a full set of standard relational features, including the ability to define table schema, execute queries, and define and execute stored procedures. You can execute InterSystems SQL interactively from the Management Portal or programmatically using a SQL shell interface. Embedded SQL enables you to embed SQL statements in your ObjectScript code, while Dynamic SQL enables you to execute dynamic SQL statements from ObjectScript at runtime. While static SQL queries offer predictable performance, dynamic and embedded SQL offer flexibility and integration, respectively.
As a developer who uses Cache as DB for a couple of projects, I'm using REST API's every time, knowing how to consume a resource from REST API, in my opinion, it's crucial to know how to consume external REST Api's using %Net.HttpRequest because it enables integration with modern web applications and services, and it's a crucial skill for a backend developer who loves and uses Cache as a DB.
What and who is %Net.HttpRequest
What is XML?
XML(eXtensible Markup Language) is a flexible, text-based, andplatform-independentformat used to store and transport data in a well-structured way that is both human- and machine-readable. XML permits users to define custom tags to describe the meaning and organization of their data. For example: <book><title>The Hitchhiker's Guide</title></book>.
My guess is that most IRIS developers create their applications using its native ObjectScript language or, if using an external language, then most likely using either Java, Python or perhaps C++.
I suspect that only a minority have considered using JavaScript as their language of choice, which, if true, is a great shame, because, In my opinion and experience, JavaScript is the closest equivalent to ObjectScript in terms of its ability to integrate with the IRIS's underlying multi-dimensional database.
Over time, while I was working with Interoperability on the IRIS Data Platform, I developed rules for organizing a project code into packages and classes. That is what is called a Naming Convention, usually. In this topic, I want to organize and share these rules. I hope it can be helpful for somebody.
I am looking to view the contents of the request object I am sending from my Service into my BPL in Message Viewer. My request contains references to other defined classes.
$System.Util.GetEnviron("USERPROFILE") returns "C:\WINDOWS\system32\config\systemprofile". I don't know what that is, but that folder doesn't even exist. The correct value which I need is "C:\Users\robert.steed", as seen via the Windows command line "set" command.
Folks!
Recently I found several one-line long ObjectScript commands on DC and think that it'd be great not to lose it and to collect more!
So I decided to gather a few first cases, put in one OEX project, and share them with you!
And here is how you can use them.
1. Create client SSL configuration.
set $namespace="%SYS", name="DefaultSSL" do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name)Useful if you need to read content from an URL.
Don't forget to return to a previous namespace. Or add
n $namespaceIf you start with InterSystems ObjectScript, you will meet the XECUTE command.
And beginners may ask: Where and Why may I need to use this ?
The official documentation has a rich collection of code snippets. No practical case.
Just recently, I met a use case that I'd like to share with you.
When you build an IRIS container with Docker, then, in most cases,
you run the initialization script
iris session iris < iris.script
Hi,
I'm trying to run some scripting in Windows. I'm using an instance of the IRISHealth community.
I'm just trying to run a simple sequence of commands so I can run irissession in a non-interactive mode, like:
irissession.exe IRISHEALTH -U "%SYS" < "myprogram.iris"
The contents of my program.iris are, for instance, these ones, to run an online backup:
set$namespace="%SYS"set cbk = "C:\Test1.cbk"set log = "C:\Test1.log"w$$BACKUP^DBACK("","F","MyBackup",cbk,"Y",log,"NOINPUT","Y","Y", 1000, "Test1")
HALTThe execution starts, but then gets completely hung, I see infinitely:
Starting out with ObjectScript, it is really exciting, but it can also feel a little unusual if you're used to other languages. Many beginners trip over the same hurdles, so here are a few "gotchas" you'll want to watch out for. (Also few friendly tips to avoid them)
NAMING THINGS RANDOMLY
We have all been guilty of naming something Test1 or MyClass just to move on quickly. But once your project grows, these names become a nightmare.
➡ Pick clear, consistent names from the start. Think of it as leaving breadcrumbs for your future self and your teammates.
MIXING UP GLOBALS AND VARIABLES
To better understand Streams in IRIS I'll start with a short
In the beginning (before IRIS), there was just basic access to external devices.
The 4 commands OPEN, CLOSE, READ, WRITE still work and are documented
by Introduction to I/O in detail.
Especially for files, this is a direct access to your actual file system.
You have to take care of any status or other signal in your code.
Also, any code conversion or similar is up to you.
I have a custom defined priority field that is being stored as a number type
<record name="LocalClinicalMeSHTerms" type="serial">
<field name="LocalClinicalExpertiseCodedValue" type="{CODETYPE}" codeFamily="HSPD" codeTable="LocalClinicalExpertise" codeScheme="{MASTER}"/>
<field name="LocalCliniclDisplayOrder" type="number"/>
</record>However, within the overviewIndividual.cls form
The ObjectScript language has incredible JSON support through classes like %DynamicObject and %JSON.Adaptor. This support is due to the JSON format's immense popularity over the previous dominance of XML. JSON brought less verbosity to data representation and increased readability for humans who needed to interpret JSON content. To further reduce verbosity and increase readability, the YAML format was created. The very easy-to-read YAML format quickly became the most popular format for representing configurations and parameterizations, due to its readability and minimal verbosity. While XML is
This code provide the configured production items with enabled or disabled status.
Include (Ensemble, EnsUI, EnsUtil)
Class Test.ProductionConfig
{
Hi Community,
I’m trying to execute a directory query in InterSystems IRIS using %SQL.Statement, but encountering an unexpected error.
Details:
The following command confirms that the directory exists:
Set dirPath="\\MYNETWORK_DRIVE\DFS-Shared_Product\GXM"
Write ##class(%File).DirectoryExists(dirPath)
It returns 1, meaning the path is valid and accessible.
However, when I try to execute this SQL query:
Set File=##Class(%SQL.Statement).%New()
Set Status=File.%PrepareClassQuery("%File","FileSet")
Set Result=File.%Execute(dirPath)
If Result.%SQLCODE {
Write Result.%Message
}
I get the error:
I was really surprised that such a flexible integration platform with a rich toolset specifically for app connections has no out-of-the-box Enterprise Service Bus solution. Like Apache ServiceMix, Mule ESB, SAP PI/PO, etc, what’s the reason? What do you think? Has this pattern lost its relevance completely nowadays? And everybody moved to message brokers, maybe?
Managing IAM can be tedious when done manually — especially when your APIs are already well-documented using OpenAPI (Swagger) specs. Wouldn't it be great if you could automatically generate Kong services and routes directly from your OpenAPI spec?
That's exactly what this ObjectScript method does: it reads an OpenAPI 2.0 spec stored in the XData block of your spec class and generates a decK-compatible YAML file that can be used to sync your IAM configuration.
InterSystems FAQ rubric
The ^%GCMP utility can be used to compare the contents of two globals.
For example, to compare ^test and ^test in the USER and SAMPLES namespaces, it would look like this:
*In the example below, 700 identical globals are created in the two namespaces, and the contents of one of them is changed to make it the detection target.
I’ve been exploring options for connecting Google Cloud Pub/Sub with InterSystems IRIS/HealthShare, but I noticed that IRIS doesn’t seem to ship with any native inbound/outbound adapters for Pub/Sub. Out of the box, IRIS offers adapters for technologies like Kafka, HTTP, FTP, and JDBC, which are great for many use cases, but Pub/Sub appears to be missing from the list.
Has anyone here implemented such an integration successfully?
For example:
I joined InterSystems less than a year ago. Diving into ObjectScript and IRIS was exciting, but also full of small surprises that tripped me up at the beginning. In this article I collect the most common mistakes I, and many new colleagues, make, explain why they happen, and show concrete examples and practical fixes. My goal is to help other new developers save time and avoid the same bumps in the road.