Hi, colleagues!
When you export the Caché ObjectScript code to VCS (Git, SVN, Perforce, etc) do you export the Storage schema for persistent classes? If so, what are the Pro/Contra?
Thanks!
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.
Hi, colleagues!
When you export the Caché ObjectScript code to VCS (Git, SVN, Perforce, etc) do you export the Storage schema for persistent classes? If so, what are the Pro/Contra?
Thanks!
Hi -
In Management Portal I can view Processes and their details.
I have a long running job and would like to set the "Client Application Details" -> "Info" indicator in my code so that I can monitor the process.
Does anyone know how I can set that string in my COS code?
TIA
which queries can search for text containing words of interest in Cache?
This is a translation of the following article. Thanks @Evgeny Shvarov for the help in translation.
Let's assume that you wrote a program that shows "Hello World!", for example:
write "Hello, World!"
The program works and everyone is happy.
With time, however, your program becomes more complex, gets more features and you eventually need to show the same string in different languages. Moreover you don't know the number and names of these languages.
The spoiler below contains a description of how the task of multi-language localization is solved in Caché.
how to convert $$zt^%zu2f%zt to macro?
What are the differenent format handles the data from Rest services?
Looking for a way in which I could possibly pass a flag through a property when performing an Insert statement, on a mapped class.
insert into my.class (serialNumber, modelNumber, myFlag) value ('testSerial', 'testModel', 0)
myFlag is not stored in the DB.
The mapped class then calls a legacy routine (MAC) via CodeMode = 'objectgenerator', (Insert method within the 'objectgenerator')
Within the legacy routine, I am setting an index... but I don't always want to set it (multiple inserts, and I will only set the index on the LAST insert)
How can I pass that flag through the insert call?
What is a correct way to pass parameters to the %CONTAINS in embedded SQL statement when searching thru %Text property?
s sp="child,health"
&SQL(
DECLARE c1 CURSOR FOR
SELECT ID INTO :id FROM ICD WHERE Name %CONTAINS (:sp)
...
is not the same as executing the following in the SQL Manager
SELECT ID FROM ICD WHERE Name %CONTAINS ('child','health')
As we've all heard 2016.2 draws near and brings the removal of system methods with it.
There are two ways to make the code compatible with 2016.2:
Say you have a global in one database that you instead want to map from a different database. If you just create a global mapping to the new database, the existing global will become inaccessible because it still lives on the old database. The documentation notes this problem here but doesn't give details on how to fix it.
When you create the global mapping you need to explicitly move the existing global to the new database. This is possible using the merge command along with extended global reference. The environment syntax lets you reference a global in a specific namespace, directory, or

On the back of my recent post on writing bug-less code I wanted to raise a few suggestions (to ISC) that would help prevent certain types of bugs at compile time. I've probably missed a few, but these are the main ones in my mind. Please contribute more suggestions.
Btw, these also serve as potential gotchas for new COS developers.
I except that introducing these types of changes can cause legacy code problems.Particularly where developers do some interesting overloading of method arguments.
Cache Studio almost always crashes when I click rows in Call Stack view during debugging. Then Cache has to be restarted because last edited file remains locked.
Looks like I'm the only one who uses the debugger. Or is there a magic spell to make stack view working?
Cache 2016.1.1
Is it possible to export PRJ file without section BreakPoints and Target attribute? /diffexport does't help.
They just make noise when pushing into GIT
I have classes A and B, B derived from A, A has method Abc.
From INT of class B I see that compiler copies implementation of Abc to class B, so that Abc exists both in A and B.
As result, when B invokes Abs, B.Abs() is executed instead of A.Abs(). In result debuger is not able to step into Abs and breakpoints in A.Abs never hit.
Why this happens and how can I avoid this?
Update:
OK, now I know the reason: compiler makes the copy if Abc has this line:
s cn=##Expression($$$quote(%classname))
hmmmm...compiler needs name of method's class so it "moves" the method to child class.
With help from others here I had developed some code to take a Base64 PDF within a OBX.5 and save it locally to the file structure on the server.
I had to make a change to the code to return me a String so I can pass the Path back into Ensemble to use it in the message. When I made this change I am getting " ERROR #5034: Invalid status code structure ("/ensemble/data/transfer/AncillaryPDF/TMSAUDIO/Apr-11-1/980512729TMSAUDIO1046784936436537800.pdf")"
Here is the code...
ClassMethod DecodeBase64HL7ToFile(base64 As %Stream.GlobalBinary, Ancillary As %String, FileName As %String) As %String{setIn case of system exception (missing property, method etc) Cache Studio's debugger stops at the line throwing it. Unless the line is in try/catch block.
Is there a way to make it break also in try/catch case?
Cache 2016.1.1
Hi All,I got an error when i compile one class. the error was objects of class are (classname) instantiated in 1 processes.how can i recover the problem. my cache instance is Cache 5.0
To set up Web Application, I need to turn on the DeepSee flag using Caché ObjectScript. How can i do it?
Hi All,
Am attempting to run sample unit tests as per
and getting an ERROR #5007:
The Terminal detail is as follows:
SAMPLES>Set ^UnitTestRoot="C:\UnitTests"
SAMPLES>write ^UnitTestRoot
C:\UnitTests
SAMPLES>do ##class(%UnitTest.Manager).RunTest("MyTests")
ERROR #5007: Directory name '/usr/cachesys/mgr/samples/C:/UnitTests/MyTests/' is invalid
SAMPLES>
The '/usr/cachesys/mgr/samples/' part is the correct path for the namespace 'SAMPLES' and the
Hello, we have a few hundreds of triggers to port from Oracle to Cachè for a migration project, and many of them have to change (for example, normalize a value, null it, etc) the value which is being inserted.
The documentation says "You cannot set {fieldname*N} in trigger code." , so we're unlucky.
Is there a good workaround for this ?
SqlComputeOnChange doesn't seem the best way, but I'm not totally sure: for example normalization and validation could have a better place somewhere else than a trigger.
Hi!
Does anyone know if it is possible to programmatically (COS) read the productdescription from other namespaces?
What are the differences between a process private global and a percent variable? Basically I have some code running in an Ensemble operation that processes requests, and it needs access to pieces of data that are scattered throughout XData blocks in various classes. Rather than opening the XData object and deserializing the XML on each request, I opted to cache this data in a percent variable, something like:
set %MyVar(sub1,sub2) = myValue
Which works out nicely: it's accessible from any code invoked by the operation, it persists for as long as the operation is running, and I can clear it
Hello,
We are working on creating a metadata file to accompany PDF documents produced by one of our third party systems for ingestion into our DMS. One of the pieces of data that the metadata file must contain is the number of pages of the PDF document.
In Cache ObjectScript does anybody know if there is currently a way of counting the number of pages within a file (specifically a PDF) without invoking a non-Caché ObjectScript program/function from within Caché ObjectScript?
If we have to invoke a non-Caché ObjectScript program/function from within Caché ObjectScript then we will but we wanted
Does there exist a User Defined Language pack for Caché ObjectScript for use in Notepad++? I'm hoping some friendly developer somewhere may have created one . http://docs.notepad-plus-plus.org/index.php/User_Defined_Language_Files
Hi everyone,
I've created an Identicon Generator inspired on Fabio GonçalvesCaptcha Validator.
This sample can be used to create Identicons for users of app for example, it can be useful to use in Zen Mojo applications, generating an identifier image based on name of the user by example, but it can be used in others kind of applications too(Zen, CSP etc)
Examples:
First one:

Will generate this:

And this:

Will generate this:

See my Github project: https://github.com/AndreiLN/Ikon
Best regards,
Andrei L. Nenevê
Inspired by the article "Declarative development in Caché" that's still trending on the dev com. The OP explored a functional style of iterating over a collection. A comment today suggested "Caché would need syntax support for anonymous functions".
With Macros you can kind of get anonymous like syntax using dot notation.
This is not production code, but it does work. First the macros...
#Define foreach(%c,%l) for i=1:1:%c.Size set %l=%c.GetAt(i) do #Define map(%oc,%nc,%l) set %nc=##class(%ListOfDataTypes).%New() for i=1:1:%oc.Size set %l=%oc.GetAt(i) do do %nc.Insert(fpl8349312378) #Define
Hi All,
We using cache 5.02.We have some problem regarding license usage.
I have a number of Business Process and due to the complexity these were created as "custom code" instead of BPL.
These processes currently invoke other components using SendRequestSync. For a couple of reasons I would like to be able to change these to use SendRequestAsync:
Let's say I have two classes: A and B. They share no common parent except %SystemBase. But these classes have some properties with the same name (type may be the same or not):
Class A {
Property data As C;
Property data2;
}Class B {
Property data As D;
Property data3;
}I need to automatically convert object of class A into object of class B. I'm planing to write a class generator that generates a separate class that converts A to B. It would work like this:
1. Query %Dictionary to get list of properties:
2
Hi,
I was wondering if we have some documentation and sample code how to create APNS and GCM using Caché ObjectScript.
Thanks
Kumar