Hi developers!
I have an existing CSP app and I want to add a role to it. How can I make it programmatically?
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 developers!
I have an existing CSP app and I want to add a role to it. How can I make it programmatically?
Hi! I have a promblem with ##class(%File).Exists -method and scandinavian characters.
Ensemble: Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2018.1.2 (Build 309_5U)
I have a business service (EnsLib.EDI.XML.Service.FileService (charset=binary)) which reads XML-files from the server and transmits those to the business process. BP request class is EnsLib.EDI.XML.Document. In BP I have code block
SET SourceConfigName = process.%PrimaryRequestHeader.SourceConfigName SET SrcPath = ##class(Ens.Director).GetAdapterSettingValue(SourceConfigName,"FilePath",.tSC) SET AttachFileName = request.
I am updating the PV1 segment with values from the database but when I get two values back I dont know how to separate them with a tilde and insert. Any advice for me on that?
so if I get two values returned
my PV1.7 segment should be :
My current code is as below: It works fine for one value, but when there are more than 2 values returned I need to find a way to include it
Set sc=res.Prepare(sqlstring,,conn)
{
s RET = res.GetData(2)
}
s sc=res.Close()
Set sc=conn.
Hi Community,
Please welcome the new video on InterSystems Developers YouTube:
Following instructions on this page https://docs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=D2IMP… I am trying to create a Data Connector to be used as a base class for a cube with update support.
That page suggests that putting an SQL query inside XData block is not suitable for a Data Connector that supports updates.
Later it also suggests that to enable updates your SQL query must include
WHERE $$$RESTRICT
Providing an example of it in XData block example like this
<sql>SELECT A,B,C FROM MyApp.
Announcing gj :: locate. A simple extension for VS Code that will help you get to the source of your errors.
In VS Code, using either the Serenji extension or the basic InterSystems objectscript extension, this small add-on will open the appropriate class or routine and position you at the exact line where an error occurred.
No more tedious counting of lines to find <UNDEFINED>zCredit+206^Ledger.Invoice.1. Instead, with gj :: locate you can get there with just a couple of clicks.
This 20 second video tells it all:
Download now and enjoy getting to the source of your errors.
Hi Community,
I am trying to access another process's content of objects like %request and %session. I am using the class/method "%SYS.ProcessQuery:VariableByPid". Does anyone knows how to get the value of the properties like %request.Data("ID",1) from one process that is running on the DB server?
Example of what I am trying to do:
set rs=##class(%ResultSet).%New("%SYS.ProcessQuery:VariableByPid")
set tsc=rs.Execute(ProcessID,"%request")
while rs.%Next() {
w "Name:"_$g(rs.Data("Name")),!
w "Value:"_$g(rs.Data("Value")),!
}
do rs.
You may think it isn’t too difficult to get from label+offset^routine to the actual source line responsible for the error. For an expert it isn't that hard... most of the time. But there are enough oddities and special rules that even an expert can get it wrong, whilst spending a lot of time trying to get there.
gj :: locate is the latest tool from George James Software – it debugs any error, class or routine by converting the location of an error in compiled .int code to the corresponding location in your source, and then taking you right there.
Image this scenario…
I checked out a Git-Branch and want to Import all Objectscript-Objects to my localhost.
While using Import without Compilation I receive a lot of errors.
request to http://127.0.0.1:57772/api/atelier/v3/TSTCBW/doc/MusLT01LCOD.int?ignore… failed, reason: connect ECONNREFUSED 127.0.0.1:57772
While using Import and Compile I receive much more of this errors.
Is there a setting, that I have to key in?
Or how can I synchronize my namespace to test my changes?
I have a CSP page that is supposed to show some user info (Full name and some other properties retrieved from AD)
I am unable to get them outside of %SYS namespace using Security.Users class. Is there another mechanism to do that, or I am using Security.Users class incorrectly?
Hi folks!
Often while debugging you want to know the values of all the parameters.
Using VSCode Debugger is not an option.
What do you use to know what parameters came to the method?
My hope if you have a "magic" macro that will store all the variables with their names into a global?
And share your approaches, please?
We released a new version of ZPM (Package Manager)
New in ZPM 0.2.14 release:
See the details below.
anyone know of a simple way to search a blob of text from a list of keywords in one fell swoop, without having to iterate through each keyword and perform an individual search? Ex.
s keywords="This,blob,text"
s text = "This is a sample blob of text"
i text[keywords w "hit"
We have a Unicode installation of Cache'. A client wants to send us documents that will be machine-read and loaded, automatically. They want to create the documents in ISO-8859-1 ("Latin-1"). We'd need to convert the text to UTF8 for our system. I saw the documentation on the $ZCONVERT function, but I didn't see this option. How should it be done?
Thanks!
Background: We have our own SQL map that predates InterSystems'. A program writes an XML file for each table map class as $system.OBJ.Export would. $system.OBJ.LoadDir loads the XML files into .cls files.
The reason is a long story, but we need to update parameter EXTENTSIZE (only) in existing classes. This does not seem to happen. As a test I used $system.OBJ.
Hi Developers!
Recently we released the updated version 0.1.3 of ObjectScript Package Manager (ZPM) which comes with the support of simplified ObjectScript sources folder structure.
What 'simplified' does mean?
Before 0.1.3 ZPM expected the following structure:
/src ---/cls - for ObjectScript classes ---/cls/package_name/class_name.cls ---/cls/package_name/class_name2.cls ---/mac - or Mac ObjectScript routines ---/mac/package_name/mac_routine.mac ---/mac/package_name/mac_routine2.mac ---/inc - for ObjectScript macro include files. ---/inc/package_name/include_file.inc
Hi Developers!
Many of you publish your InterSystems ObjectScript libraries on Open Exchange and Github.
But what do you do to ease the usage and collaboration to your project for developers?
In this article, I want to introduce the way how to introduce an easy way to launch and contribute to any ObjectScript project just by copying a standard set of files to your repository.
Let's go!
Moving over from Studio To VSCode like many other will do now the ObjectScript plugin reached version 1.0, I noticed I was missing some items in the objectscript explorer. For example when creating a Rest API using the spec first approach, 3 classes are generated, an application.impl, application.disp and application.spec class, but the disp class was missing in the Object Explorer.
As the application.disp is a generated class, for showing these classes you need to turn this on by hitting the switch on the object explorer:
.png)
There's also a switch to enable/disable System Items.
A while back I asked the developer community for a way to loop through repeatable HL7 segments and check them against a Data Lookup table within a Business Rule.
The example I got was the following...
ClassMethod GroupIDExists(pHL7Msg As EnsLib.HL7.Message, pSegment As %String, pField As %String, pLookupTable As %String) As %Boolean
{
#dim tSeg as EnsLib.HL7.Is there an easy way to see if a class object has been compiled or needs to be? Or to get a list of classes that need to be compile in a particular namespace?
Hey everyone.
I have a process where I create a new %Stream.FileCharacter object, specify the filename (including it's path), write data to the stream, and then save. However for some reason, if the user account does not have write access to the directory, the %Save method is still returning true even though it was unable to actually write the file to the folder.
The location is a UNC path, and I'm wondering if this is tripping me up?
I had a challenge recently where I was asked to parse and iterate JSON to find a patient that has a forename = "Bill" and try to make the function that iterates through the code re-usable.
Being working in Healthcare there isn't much experience or demand for parsing JSON, as most of my work is HL7.
I took this on using the documentation and worked out a way to parse the JSON (see posts below for code and source data).
I've worked out how to iterate through the fields and repeating elements, however I'm having an issue quitting out upon finding a patient with the forename Bill.
Hi, folks!
Sometimes I need to schedule a task programmatically.
And in 99% I need having some class method be periodically called.
And I want to have the schedule be started by one line. As a job in crontab.
I decided to introduce such a module with iris-cron-task module.
See the details below!
In previous versions of cache I used to be able to write click on a class and get a delete class option but in this version I can not find the delete class option was wondering if there is another way to delete a class if you wanted to do some house keeping.
N.B. These are the classes I create not the ones that comes with cache.
I have a quick question regarding swizzled objects.
I have an original object, say Object a, I am working with.
I set a property a.something.somethingother.somethingelse.myNewProperty to some value x.
Then at some point I am saving a and continuing to work with it. I assume here by saving a, I saved myNewProperty as well. (as it should work)
At some point I would like to make certain that I have correct value in my myNewProperty, so since I happen to know it's ID I
open it directly:
Set ref=##class(somethingelse).%OpenId(Id)
but when I try to look at my ref.
So now that I have figured out how to send a Page via HTTP.OutboundAdapter, I have another question. I want to use a Function that all I have to do is pass two variables and it is sent to the HTTP.OutboundAdapter I created to send the Page.
So.. If I have a class file that Extends Ens.Rule.FunctionSet, how do I force it to send a Request to my HTTP Business Operation, without having to go through a DTL, or Business Process?
Thanks
Scott
I am trying to figure out how to send a Page via a HTTP.OutboundAdapter to a URL from Ensemble.
We have a URL that I am able to pass PNo=xxxx%PMsg=xxxx as parameters to send the page to a pager.
http://xxxxx.xxxxx.xxx/Employee/Tools/Paging/SendPage.aspx?PNo=1817&PMs…
When I send the above URL through a REST client I receive a Response of "SENT".
But when I try to send it through the HTTP.OutboundAdpater I do not get a response.
.png)
Visual Studio Code is a compatible IDE for InterSystems technology!
Visit the resource guide to learn more about the VS Code IDE and how to use the ObjectScript extensions.
As a Belgian leader in developing and operating entertainment solutions in the sports betting and casino games sector, Bingoal is a dynamic and ambitious company looking for a passionate Back-End Software Engineer. Together with the IT team, you will be working to create scalable and easy to maintain software having an impact on the core of Bingoal’s activity.
We are looking for a developer with InterSystems ObjectScript Experience.
I need another set of eyes to look at the following. Instead of a Data Lookup table, I wanted to try to lookup a value against a Cache table that I had build. So I thought I could write a function to run a simple SQL query against the Cache Table and return me a %Boolean value back to my routing rule. However today I found that it was not working properly.
Can someone take a look at the following method and verify that I am doing this correct?