ObjectScript allows you to pass any number of arguments using arrays. Do it by adding ... after the argument name.
An example is as follows. In the example statement, the argument information is set in a global variable (a variable stored in the database) so that it can be easily checked after the method is executed.
Below is a simple alert processor based on the EnsLib.HTTP.OutboundAdapter to send text alerts via an SMS Gateway service. Typically, all that is needed to send an HTTP Post to the gateway service is the destination phone number, a source phone number, credentials, and the URL.
The code below is based on the Anveo gateway whose interface is as follows:
The InterSystems ObjectScript language does not allow you to define methods of the same name with different arguments. It is generally classified as a programming language called a dynamic language.
In ObjectScript, you can freely control which arguments are used when executing a method, so unlike languages such as Java, which are not dynamic programming languages, there is no need to strictly distinguish methods by the number of arguments at the compilation stage.
Configuring an Ensemble production can be a challenging task involving a thorough understanding of the system and production functionality and a detailed understanding towards each configuration item. After successfully configured an Ensemble production, you might need to set up an identical production on the mirror environment, or deploy the production on a development system to a live system, or send a copy for diagnostic/debug purposes. Other times you might have spent some time designing a BPL/DTL and some other productions can use the same logic.
First post! In order to somewhat redeem myself for an unnecessary call to support, I've decided to post some classes that I've written to monitor certain metrics inside our Ensemble Live instance (yeah, Kyle, you WERE laughing at me, but it's okay). What the classes do is to run queries and code to get database sizes, status of the mirror, counts of rows in tables such as EnsLib.HL7.Message and Ens.MessageHeader. The data is collected and written to tables and then an email is sent out daily upon completion. I've found this quite useful in keeping an eye on what's going on. It's help
You can programmatically retrieve routine dates and sizes using the RoutineList query of the %Library.Routine (or just %Routine) class.
The RoutineList query has an argument, and the routine name to be searched can be specified by prefix match or middle match. (For wildcards, specify * or ?)
In the example below, *.MAC is specified as an argument.
To resolve the error <PROTECT>, remove the read-only attribute of the system-wide library database (IRISLIB for InterSystems IRIS, CACHELIB for Caché/Ensemble/HealthShare (Caché-based))
Once you have finished importing the routine, remember to change it back to read-only.
[Version 2013.1 and above] [Management Portal] > [System Administration] > [Configuration] > [System Configuration] > [Local Database] Uncheck "Mount read-only" from the database name link.
InterSystems ObjectScript is perhaps the best language on the planet to deal with globals - and it is an interpretable language.
Yes, it has a compiler. But even the compiler can compile some lines in ObjectScript which will then fire as bugs during the runtime.
There are some technics on how to avoid that such as unit testing, coding guidelines and your coding experience, of course ;)
Here I want to present to you the yet another approach to how you can reduce the number of errors in your ObjectScript runtime and enforce coding guidelines - it's an ObjectScript Quality tool developed by Lite Solutions, InterSystems solution partner.
I recently learnt something new while working with WRC on an issue, and I wanted to share with everyone on the off chance it could help someone else.
Scenario:
Files are being inexplicably written to a folder on your server and, due to the number of files in the folder and general system throughput, it is not possible to work through the files to track down the source.
If you deal with multiple instances of Caché / Ensemble / HealthShare and sometimes have to work at the Terminal command prompt, did you know that you can easily add extra information to that prompt which may help prevent you running a command on the wrong instance?
Personal data privacy regulations have become an indispensable requirement for projects dealing with personal data. The compliance with these laws is based on 4 principles:
Using the Config.Configuration class and SYS.Database class methods, you can create and register a namespace database from the terminal.
Below is a series of execution examples that create database file /CacheDB/AAA/cache.dat and register database AAA and namespace AAA in the configuration file (cache.cpf). * Execute in the %SYS namespace. *
* Make sure that this script runs as the user that is used for all IRIS processes to ensure that the directory has appropriate ownership and permissions *
At least three different ways to process errors (status codes, exceptions, SQLCODE etc is given in ObjectScript. Most systems have status, but for a range of reasons exceptions are more convenient to manage. You spend some time translating between the various techniques dealing with legacy code. For reference, I use several of these excerpts. It is hoped that they will also support others.
If your application is raising <PROTECT> errors and you're finding it hard to work out why, here's a way to get additional information.
First, if auditing is not already enabled, turn it on:
Then use "Configure System Events" (highlighted above) and locate the event named %System/%Security/Protect. In the screenshot below I used the Filter field to do this (type "protect" - highlighted below - and press TAB):
Since SELECT ... FOR UPDATE is implemented in many RDBMS as a method of explicit row lock acquisition, I think there are many cases where this function is used.
This syntax is not an error for InterSystems products, but it does not acquire row locks as expected.
This article will show you how to achieve equivalent functionality.
To remove InterSystems products installed on your Windows system, use Add or Remove Programs in Control Panel (in Windows 10, select Apps from Windows Settings).
Since we will be making changes to the system, you will need to log in as a user with administrator privileges.
1) Log in to the system as an administrator.
2) From the system tray, exit the launcher of the InterSystems product instance you want to uninstall (click launcher → exit).