Hi, Community!
Please share your experience on code deployment on production site. Do you compile ObjectScript on Production? Is it OK?
Or you only compile on Test site and copy cache.dat to a Production?
The tool that compiles source code to another form of executable code.
Hi, Community!
Please share your experience on code deployment on production site. Do you compile ObjectScript on Production? Is it OK?
Or you only compile on Test site and copy cache.dat to a Production?
In my previous article, we reviewed possible use-cases for macros, so let’s now proceed to a more comprehensive example of macros usability. In this article we will design and build a logging system.
Logging system is a useful tool for monitoring the work of an application that saves a lot of time during debugging and monitoring. Our system would consist of two parts:
Class Queries in InterSystems IRIS (and Cache, Ensemble, HealthShare) is a useful tool that separates SQL queries from code. Basically, it works like this: suppose that you want to use the same SQL query with different arguments in several different places.In this case you can avoid code duplication by declaring the query body as a class query and then calling this query by name. This approach is also convenient for custom queries, in which the task of obtaining the next row is defined by a developer. Sounds interesting? Then read on!
hi-
Can someone give me an example of how to JOB a class method that requires an array of values to be passed to it by reference.
This is what I tried, but am getting compile errors because of the .params
job ##class(%SYSTEM.OBJ.FM2Class).All(.params)::5
Any thoughts on how to accomplish this, the simplest way. I would like to avoid writing all of this to some global and having to write some wrapper to pick it up and then call the class method, which I certainly could do. but is this the only way to do it?
Hello.
We're trying to create a script that compiles everything on a certain namespace, for that we are depending on CompileAll. However it seems that this method doesn't check for a dependency tree even when using flags like: curb.
Due to its apparent alphabetical nature, classes that come first but depend upon classes that come later fail to compile because their object still doesn't exists. Example:
Suppose we have to compile a class in which its name starts with A and it has a Parameter which contains an expression that calls for B.
In this case, A would fail to compile because B is not
How do I compile a file through the command line?
I am generating a very basic csp page in a bash shell, it is generating fine and displays what I want to see as long as I go into studio and compile it . This defeats my purpose of having the page and I am having no luck figuring out what I am doing wrong. I think the issue has to do with the file not being included when I compile from command line.
Ver is 2017 running RHEL 7
From command line I see
TST 3f2>DO $SYSTEM.OBJ.Compile("csp.vvmaccessnewrds","h")
Compilation started on 06/24/2020 09:47:26 with qualifiers 'h'
Compiling class

Constantinople in the 5th century AD
(It was possible for people to build grandiose buildings and vehicles without the use of computers and robots 1,600 years ago.)
If you assign dimensionless numbers to physical parameters in your code, you risk misunderstandings and errors when calculating and converting between units of measurement.
When dealing with a support issue of one of our Deltanji source control sites this week I learned that if you're using InterSystems versions earlier than 2018.1 on Unix-type platforms it's possible that a class you export in UDL format will subsequently fail to import. So I'm posting this information here in case it helps other folk.
If you're doing Zen development your classes are likely to contain ClientMethod definitions scripted in Javascript.
As a developer, you have probably spent at least some time writing repetetive code. You may have even found yourself wishing you could generate the code programmatically. If this sounds familiar, this article is for you!
We'll start with an example. Note: the following examples use the %DynamicObject interface, which requires Caché 2016.2 or later. If you are unfamiliar with this class, check out the documentation here: Using JSON in Caché. It's really cool!
##Example
You have a %Persistent class that you use to store data. Now, suppose that you are ingesting some data in JSON format, using the %
First, my $ZVERSION:
Cache for OpenVMS/ALPHA V7.x (Alpha) 2010.1.6 (Build 952_2 + Adhoc 17754) 3-JAN-2018 14:32:54.07
Second, my issue:
I believe my current villain is “incremental compiling.” I was able to compare early compile output with later compile output:
Compilation started on 04/10/2019 10:46:32 with qualifiers 'cuk' Compiling class UnitTests.Task3496 incremental compile detected Compiling routine UnitTests.Task3496.2 Compilation finished successfully in 0.800s.
... several compiles later...
Compilation started on 04/10/2019 13:35:33 with
Hello everyone,
I'm trying to migrate the IDE for programming in COS, we normally use the Studio, but we want to use a more modern IDE. Our team has knowledge with Visual Studio plataform, but we couldn't configurate the compiler and terminal, I installed the extension InterSystems ObjectScript and tried to configurate to connect with my local machine, unfortunately the connection don't sucessed.
Someone has material for how i can connect and compile? Some material i saw show how to use the compiler, but not how can i do the configuration.
Best regards,
Flávio.
In most cases, if one class depends on another, the class compiler will detect this and determine the correct compilation order. For example:
Yet sometimes, a developer needs to specify compilation order. InterSystems class definitions contain two keywords for this, DependsOn and CompileAfter, that are very similar but not identical.
I have just imported our Ensemble project (not a really big one, like two man-years) into my MacBook Air Ensemble 2016.3 instance to test many things (document model, etc.), Atelier among the others.
The "Production view" is not here, and I miss it.
The opening of Diagram Editor for BP is pretty hidden. I would even like having a switch, which would default to the Diagram Editor.
Anytime I click on the Open Diagram Editor, it waits for a while, ten produces an error and only then I can see the diagram.
The error says: Your Studio browser is no longer valid... etc.
I cannot find an easy access to
Using our cool new debugging extension for Visual Studio Code I'm trying to debug a CreateProjection method of a class, but when I compile it the work apparently gets done in one of the worker jobs, so my breakpoint never triggers.
Is there a compiler flag or qualifier to force the compilation to be done in-process rather than getting handed off to a worker job?
When I try to compile through Atelier (Compile Project), I noticed that in compilation with error it returns this message 'Failed to read /api/atelier/v1/ ...':
No additional Atelier files to synchronize.
Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck
Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck
Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck
Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck
Does anyone know what can it be?
I'm using Atelier beta (latest), with web application configured as
Hi community!
Is there any way to create new method keywords?
For example:
ClassMethod TestOne() [ MyKeyword = MyValue ]
{
// Implementation
}Another doubt (maybe another topic)
How can I generate new methods at compilation time for the same class?
I tried method generators, but It only gets compiled when I compile for the second time.
I also read this comment but I could not find out how to generate the methods and get them compiled in the first compilation.
For example:
Class util.Test
{
ClassMethod TestOne()
{
Write 1
}
ClassMethod TestTwo()
{
Write 1
}
}
Expected:
Cl
Hi everyone
I'm coding a script in order to validade an installation package following the steps:
In some specific cases I will need to terminate the current process and start a new one with some new parameters.
With any code inside my try catch block, whenever I terminate the process I receive a RESJOB and it works perfectly.
When my job is running a compilation ($SYSTEM.OBJ.Compile(.classes)) and receive a RESJOB, it does not catch the exception.
During programmatic classes compilation performed by the code like this:
set status=$system.OBJ.Load(updaterFile,"cruk-d",,.resList)
strange messages appear in console log, e.g.
05/06/18-15:54:12:424 (308512) 0 oops: was expecting crc 0x21e96e85,5a4c8b2c for rtn (Update.Import.1) rbufnum-15523 ... 05/06/18-16:17:45:305 (4224) 0 oops: was expecting crc 0x21e96e85,5a4c8b2c for rtn (Update.Import.1) rbufnum-15523 05/06/18-16:22:30:485 (4224) 0 oops: was expecting crc 0x21e96e85,5a4c8b2c for rtn (Update.Import.1) rbufnum-15523...(repeated 3 times)
Classes that were concerned stayed not compiled
Hi community.
I want to create a custom list inheriting %ListOfDatatypes in order to implement some methods like Map, Filter, ForEach, but I have some questions.
Just to mention, I have already read the topic about DeclarativeCOS.
When I define a property like following, caché uses %Collection.ListOfDT or %Collection.ListOfObj, as it's shown in the documentation
So if I create a new instance of my class, or create from a JSON, those properties will not
Is there a way to enumerate the compilation status of a package?
currently after deployment we are doing something like this to validate a successful load and compile of classes:
successful_compilation_count=`grep -a "Compilation finished successfully" output.log | wc -l` successful_load_count=`grep -a "Load finished successfully" output.log | wc -l`
is there a method to do this where it is a little bit more elegant/dynamic without having to maintain counts for comparison ?
In part of this post in 2016 @Eduard Lebedyuk asked if anyone knew what is meant by an "expanded class", as referred to in the text that appears when we run the ShowQualifiers classmethod of %SYSTEM.OBJ thus:
SAMPLES>DO $system.OBJ.ShowQualifiers()
...
Name: /checkuptodate
Description: Skip classes or expanded classes that are up-to-date.
I am currently trying to add a condition to a routing rule that uses the %Source property of a routing rule. Unfortunately I am getting compile errors when I use the "%", and if I get PROPERTY DOES NOT EXIST if I try and use any of field. I have tried referencing the messages as "Message." , "Record.", "FullRecordMapClassName." , "Document." . Does anyone know how to reference the properties of a record map in a routing rule, or if it is even possible? Thanks!
"Help me, Obi Wan Kenobi"?
I’ve hit the wall. I’m a one person shop who wants to start developing Cache on a mac using Eclipse/Atelier, after using Studio for the last 5 years. I’ve installed the 1.1 beta plugin, watched 6 or 7 videos from the September conference, tried several times to work through the cheat sheets, only to have connection issues or compilation issues, so at this point, I’m feeling very frustrated. The videos were interesting, but generally didn’t work as tutorials for fundamental programming operations, for me.
I feel comfortable with Objectscript and Zen development in
When a class containing a method generator is compiled, the code that implements the method at runtime is written according to the instructions in the method definition.
The definitions of these two compiler keywords looks very similar to me.
Is there any difference between these two keywords ?
When I declare a parent class as Abstract, its child class could be compiled successfully.
However, when I declare a parent class as NoExtent, some compile errors about storage references get pop up for its child classes.
Thanks.
I'm looking at adding multilingual support to a couple of open source projects I'm working on. The solutions are already developed in CSP so I am not looking for alternative approaches.
I'm wondering what would be the best approach for CSP and separate JavaScript files.
Initially I was wondering if I should bake the default system language text at compile time, or provide the end user with a language selection option at run time.
I came across $$$TEXT reading the docs...
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…
and have also discovered the
Hello, I just noticed that the following query is not allowing when using cached queries.
The compiler will accuse the code about missing a closing quote.
Just so you know, if I use this query dynamically it works, so I guess it's related to the code linting.
Query T() As %SQLQuery [ SqlProc ]{SELECT TOP 3 JSON_OBJECT('lit':'Employee from','t':%TABLENAME,'name':Name,'num':SSN) FROM Sample.Employee}The bold part is what is causing the error.
Version 2017.
I am trying to import the SalesForce Enterprise WSDL in InterSystems Ensemble Studio using the SOAP Add-In.However, when I do so I receive a class dependency loop, Error #5316 during compilation.The WSDL is the standard WSDL provided with SalesForce and works fine in SoapUI.In the SalesForce WSDL it is allowed for an object A to include an object B as an element, while at the same time object B is allowed object A as an element.I think this is what causes the class dependency loop for InterSystems.Does anyone has any suggestion how I can circumvent this error?
In this article I would like to tell you about macros in InterSystems Caché. A macro is a symbolic name that is replaced with a set of instructions during compilation. A macro can “unfold” in various instruction sets each time it is called, depending on the parameters passed to it and activated scenarios. This can be both static code and the result of ObjectScript execution. Let's take a look at how you can use them in your application.
Hi all,
I was wondering if there is any way to trigger the compilation of a class based on the compilation of another (unrelated) class. For example:
Class 1 = test.class
Class 2 = test.class.type.one
Class 3 = test.class.type.two
Every time class 2 or class 3 is compiled in Studio I would like to have class 1 automatically compiled as well.
The reason I need this is because class 1 has a method with CodeMode set to objectgenerator which generates some code based on what is found in classes 2 and 3.