#ObjectScript

14 Followers · 1.6K Posts

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.

Documentation.

InterSystems Official Raj Singh · Apr 12, 2020

I’m excited to announce that InterSystems will be joining the open source community for InterSystems ObjectScript extension to Visual Studio Code. Early this year I posted that we were on a journey to redefine the future of our IDE strategy, and what came out of that is Visual Studio Code is the IDE that can support that future. It’s fast, stable, feature-rich, and built on a modern technology architecture that affords us the ability to offer you far more functionality around your ObjectScript activities than ever before, particularly in the area of DevOps, continuous development, and

3
6 1882
Question alex chang · Apr 20, 2020

Due to bussiness requirements.I want to add some bussiness field on intersystem message view ui .

eg:

1. add new action page to display bussiness detail

2. add new function to do more  Fine-grained things.

3. add new database field in message table.

finally, I hope get more detail of messae view due to customize it.

Tks.

2
0 253
Announcement Dmitry Maslennikov · Mar 4, 2019

Hope most of you already familiar with project CachéQuality from @Daniel.Tamajon. For those who don’t know about it, it is a static syntax analyzer for your code written for InterSystems products. It may help you to find and solve many different types of issues in your code, and even possible bugs before clients will find it in production. So, with help of CachéQuality you will be able to deliver a better product. You can find the complete list of rules used to check ObjectScript code here.

It was already available in Studio. And now it is also available in VSCode.

41
1 2300
Article Jose-Tomas Salvador · Dec 20, 2018 2m read

Some weeks ago, I was reading a book by Stephen Hawking and Leonard Mlodinow, The Grand Design. At a certain point, trying to define why do we exist? , why do we use the models we use in physics?, ...those kind of things you know... they pointed at the Game of Life example invented by the mathematician John Coward in 1970... Basically he wanted to show that a system with really basic fundamental laws (Physics) could evolve and "live" to become a more complex system (Chemistry) in which "something" (humans) could work out its own model and complex rules to explain its reality… the rules for this deterministic model that he exposed were so basic that I thought it could be funny to implement them in ObjectScript when I had some spare time... there are others implementations in JavaScript and other languages... but not in ObjectScript... and that had to be corrected!!… so here you are!

10
2 967
Announcement Anastasia Dyubaylo · Apr 6, 2020

Hi Community!

We are glad to invite every developer who uses ObjectSript and VSCode plugin to the upcoming "Introduction to VSCode-ObjectScript" webinar on April 14, 2020 at 11:00 EDT. 

Speaker: @Dmitry Maslennikov, InterSystems Developers Advocate, CTO at CaretDev.

You will learn how convenient the development process can be already right now and what we are going to do next to make it even better.

Please check the agenda below.

11
1 1241
Question aqwsxcde · Apr 4, 2020

Hello community,

I recently started to work with Ensemble. I defined a subclass of EnsLib.HL7.Message.  In my production I receive HL7v2 messages and transport them using the Message Router to a business operation. The operation class has an OnMessage method with parameter

pObject As MySubclassOfEnsLibHL7Message.

I expected that specifying the parameter type, on receiving the message an implicit type cast would be performed. However, $CLASSNAME reveals that my messages are still of type EnsLib.HL7.Message. How can I convert my messages in ObjectScript (without DTLs or something the like)?

7
0 913
Article Robert Cemper · Apr 4, 2020 3m read

IRIS 2010.1 brought us a new feature: %Net.WebSocket.Client

As a continuation of my series of WS Clients I just couldn't resist to try it.
Well, this is the result and it was rather simple in the end.

  • After I succeeded in my personal fight against Windows Firewall ;-)

You basically need to prepare 3 classes:

  • Credentials for User, PW, SSL
  • an Event Listener
  • the Client (Could be a .MAC routine as well)
0
0 809
Announcement Evgeny Shvarov · Mar 22, 2020

Hi Community!

The registration phase for InterSystems Online Programming Contest ends today and we will start the voting week!

Now we have 20 applications - so you have a set of applications to choose from!

How to vote?

This is easy: you will have one vote, and your vote goes either in Experts nomination or in Community nomination.

7
1 491
Article Gevorg Arutiunian · Aug 31, 2018 1m read

This code snippet changes all passwords in a system to a specified string. The two literal strings at the beginning of the snippet can be adjusted to edit the system or password string. The class method "test" runs the code:


Class eduardlebedyuk.changePasswords Extends %RegisteredObject
{
	ClassMethod test()
	{
        set ns = $namespace
	    zn "%SYS"
	    set NewPass = "NewPassString"
	    set rs=##Class(%ResultSet).%New("Security.Users:List")
	    set st = rs.Execute()
	    while rs.Next() { set st=$SYSTEM.Security.ChangePassword(rs.Get("Name"),NewPass)}
        zn ns
	}
}
7
0 883
Discussion Maks Atygaev · Mar 28, 2020

DISCLAIMER: I am not an InterSystems engineer or a professional ObjectScript developer.

I just want to share my opinion about some things I am really miss in ObjectScript.

I really appreciate everyone who support my project (Declarative ObjectScript) in contest

but the post is not about "why you should support me" on contest.

I faced with ObjectScript in the university while was working on my diploma (in 2013).

Very good mentor @Evgeny Shvarov helped me to get started with ObjectScript development.

2
0 292
Question Yone Moreno · Mar 26, 2020

Hello,

We are developing a method to take two messages which have a list of data types. It is being defined as:

Class Mensajes.Response.HistoriaClinica.ConsultaCitasResponse Extends Ens.Response [ ProcedureBlock ]
{

Property informacion As EsquemasDatos.HistoriaClinica.Informacion;

Property datos As list Of EsquemasDatos.HistoriaClinica.ConsultaCitas;

Property error As EsquemasDatos.HistoriaClinica.Error;

}

Inside datos we have:

Class EsquemasDatos.HistoriaClinica.ConsultaCitas Extends (%Persistent, %XML.Adaptor) [ ProcedureBlock ]
{

1
0 757
Question Yone Moreno · Mar 26, 2020

Hello,

We are developing a Transformation and we are wondering: how could we debug and show a XML message which is being an output from a transformation, without storing it into request/response/callrequest/callresponse? We mean, how could we show a context variable in the production?

For example, let's have a transformation which stores an appointment in a variable called: context.especializadasConFormatoPrimarias

How could we show in the Production?

Currently it is being stored as the Transformation's output:

1
0 285
Question Yone Moreno · Mar 26, 2020

Hello,

We have a tranformation where we would like to convert a date from the following format:

"'dd/mm/yyyy' 'hh:mm'" (double quotes are just visual to indicate this is a string)

to date and time separated:

date: dd/mm/yyyy

time: hh:mm

We have already splitted the datetime into date and hour as follows:

1
0 491
Question Jack Smith · Oct 27, 2019

We have a data transformation where source is object collection (populated from a json file)  and target is EnsLib.EDI.XML.Document.

If source file is large enough, transformation fails and we get <store> error and I quickly found this:

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=EBPLR_DTL_foreach which at the bottom in "Avoiding <STORE> Errors with Large Messages" section tells to: 

1
0 541
Announcement Evgeny Shvarov · Mar 4, 2020

Hi Developers!

In March we are starting our first InterSystems IRIS Programming Contest! It's a competition in creating open-source solutions using InterSystems IRIS Data Platform.

The topic for the first contest is InterSystems IRIS, Docker and ObjectScript!

The contest will last three weeks: March 9-31, 2020

 Prizes:

There will be money prizes for Experts Nomination - winners will be determined by a specially selected jury:

🥇 1st place - $2,000 

🥈 2nd place - $1,000 

🥉 3rd place - $500

Also, there will be Community Nomination - an application that will receive the most votes in total:

🏆 1st place - $1,000

And we provide winners with high-level badges on Global Masters.

27
4 1950
Question Mario Sanchez Macias · Mar 17, 2020
 

Hi, 

I know there are several alternatives, but I would like to find the easiest & simpler ones to store data coming in Json format from post requests and also allowing me to do SQL queries. 

I want to have a property called favouriteColors. I want to store a few colors, and I want to be able to do queries to get top favorite colors, etc... so not handling the list of colors as just a fixed string or fixed object. 

4
0 635
Article alex kosinets · Mar 17, 2020 2m read

The client part of the code for this game is on the MS Excel sheet and consists of:

  1. m-commands  for random arranging ships on the playing field  (21 cells)
  2. m-command to enable on-click m-trigger on all 100 cells of the playing field (1), red font
  3. m-trigger (1), red font

The server part of the code (vmx.ro) is installed onсе, it not change depending on the task, is the same for IRIS, CACHE, 16, 8-bit encoding, any applications, games, reports.  The server side creates and maintains ‘virtual excel’ in M.

0
0 606
Question Michel Bruyère · Mar 13, 2020

In one of my class, I use Stream.Read() method of the %Stream.Object class.

  • Method OnRequest(request As Ens.StreamContainer, Output response As %Library.Persistent) As %Status
  • {
  •    SET sc=$$$OK
  •    SET strRequest=request.Stream.Read(,.sc)
  • ​​   $$$TRACE($L(​​strRequest))
  • ....  

The Trace value gives 32,000. But the Read() method of the %Stream.Object class specifies 32,656 by default.

  1. Method Read(ByRef len As %Integer = 32656, ByRef sc As %Status) As %CacheString
  2. {
  3.    Set len=0,i%AtEnd=1,sc=$$$OK
  4.    Quit ""
  5. }

Why ?

Best Regards.

2
0 974
Article Evgeny Shvarov · Mar 13, 2020 2m read

Hi developers!

Suppose you have a Github repository with ObjectScript classes but without a Docker environment.

Recently I published a repository with a set of files that form a universal Docker and VSCode environment to let you either import and run your repository in InterSystems IRIS Community Edition on Docker or turn your repository into Docker and VSCode environment for InterSystems IRIS Community Edition.

So in one sentence:

Unpack these files in your folder and you have the Docker and VSCode environment for your InterSystems IRIS ObjectScript application!

See the details below.

0
1 785