Is it possible to use a variable instead the actual class name when calling a class method?
Ex.
s var = "MyPackage.MyClass"
d ##class(var).Main()
InterSystems Caché is a multi-model DBMS and application server. See more details here.
Is it possible to use a variable instead the actual class name when calling a class method?
Ex.
s var = "MyPackage.MyClass"
d ##class(var).Main()
If the journal file is too large to be searched or filtered using the Management Portal, you can refer to it using the following two methods.
① How to use the ^JRNDUMP utility
② How to reference it in a program
================================================== ==========
① Using the ^JRNDUMP utility. For example, if you want to select all records in the journal file that include the global reference ^ABC, do the following:
*Please execute all commands below in the %SYS namespace.
DO SELECT^JRNDUMP("C:\MyCache\mgr\journal\YYYYMMDD.
Hi,
I am using embeded python to utilize some pythonic library but i got a problem on my hand.
One of the python function i am using return multiple values
in python you would do something like that :
val1, val2, val3, = function(params)
In COS I got something like that :
lib = ##class(%SYS.Python).Import("lib")
val1 = lib.function(params)And I don't know how to get the second and third values.
Is there a way to get them?
If you have system tables implementing the "VERSIONPROPERTY" functionality, you may encounter error 5800. This article explains how this error occurs and provides solutions to resolve the issue.
When version checking is implemented, the property specified by VERSIONPROPERTY is automatically incremented each time an instance of the class is updated (either by objects or SQL).
For example:
ClassMethod RunVersionChange() As %Status
{
Set sample = ##class(dado.TblSample).%OpenId("42")
Write !,"VERSIONPROPERTY value: "_ sample.VersionCheck
Do sample.Hi community,
I'm calling to a API that it is retrieving the content of a file as Content of response. I'm catching the binary but I need to convert this Stream to a Base64 string.
I'm trying to convert a %Stream.GlobaBinary to a Base64 string using the following code, but it doesn't work.
do stream1.Rewind()
set response = ""
while 'stream1.AtEnd {
set temp=stream.Read(4000)
set temp=$systemEncryption.I'm currently making some changes to legacy code and I've noticed that it uses "i $i(" all over the place. Testing in terminal seems like this does the same thing as "do $i()". Is there a difference between these two (and if not is there some interesting history around this)?
We are writing a custom Business Operation to interact with a downstream SOAP web-service. Classes for the SOAP operation were originally generated using the SOAP Wizard, then modified. This is functioning OK, but we'd now like to set the ReplyCodeActions setting on the operation and are struggling to make it visible via the management portal. How can we achieve this?
The classes are structured like this:
Hi everyone.
Is there a sensible approach to having a lookup table in Namespace A, and then accessing this from Namespaces B, C, D (etc)?
I'm trying to avoid creating a Global mapping of the lookup table global (^Ens.LookupTable) as I fear that it would then link all other lookups in that global and lead to some unexpected behaviour, but would be open to trying something in this realm if it's the best option.
Another approach I have considered is creating a custom lookup function that is run from the secondary namespaces that does some namespace hopping, but it feels messy.
Hi all,
I have a situation where I am writing to global from different processes - let's call it an Event Queue.
There is then a different process that uses $order to read through the data - the PubSub processing BP.
Sometimes the writing of this global will form part of a transaction that also insert data into other tables, using tstart and tcommit.
If there is some issue, it will roll back, and the entry written to the global will also roll back.
Hi,
I am trying to connect to another server using
I keep getting this error : SSL23_GET_SERVER_HELLO:unsupported protocol.
My guess is that the site I am reaching for uses TLS1.3 which is not supported in 2016, But I cant right now ask my client to upgrade.
Is it possible to override this ? install some kind of a patch or a more recent version of openssl on the server ?
Thanks
Amiram
The Web/CSP Gateway management page is typically configured so that it cannot be accessed from client machines.
To access from any client, do the following:
Hello,
I am trying to find or locate all Intersystems business components using a particular class. Like I want to find component is using abc.test.cls class.
.png)
Hi Community!
Do you usually work with automated tasks? Then let me share with you a pair of tips ;-)
Do you have an automated task that is running but you are not sure when it will end and you are at the crossroad of take the decision to stop it or wait and you are not sure if could be better wait for 5 o 10 minutes?
Here you are a tip to check when your task will finish (approximately).
I'd like to announce the release of something really rather interesting - revolutionary in fact. That may sound like hyperbole, but I don't think you'll have seen anything quite like this, or even thought it possible!
We've pushed out a new JavaScript/Node.js module named glsdb which you can read all about here in detail:
https://github.com/robtweed/glsdb
However, for the purposes of this announcement here, I just want to focus on one part of glsdb: its APIs that abstract IRIS (or Cache) Classes as equivalent JavaScript Objects.
Hello everyone,
I have a Cache class with just 2 fields
Property Make As %String [ Required ]; /// Model of the Motorcycle
Property Model As %String [ Required ];
I also have another class with several ClassMethods, just showing you 1 here
{ ClassMethod SaveNew(Make As %String, Model As %String)
{
Set obj=##class(JASON.BikeDB).%New()
Set obj.Make=Make
Set obj.Model=Model
Set sve=obj.
In cache studio there are features, dialog boxes, that help map data from a global to class properties.
I have used %CacheSQLStorage quit a bit, or have in the past, to map globals to classes.
I haven't been able to find a similar feature in VisualStudio.
Do I need to upgrade to IRIS to be able to use VisualStudio to map global properties to classes?
Thanks for your time,
Richard
Properties defined in list collections (Property XXX As list of %String;) can be manipulated using SQL functions: $LISTBUILD(), $LISTFROMSTRING().
For each SQL function, please refer to the document page below.
InterSystems SQL Reference - $LISTBUILD() [IRIS]
IRIS SQL Reference - $LISTFROMSTRING() [IRIS]
Caché SQL Reference - $LISTBUILD()
Caché SQL Reference - $LISTFROMSTRING()
/// Class definition example
Class ISJ.ListOfData Extends %Persistent
{
Property listdata As list Of %String;
}An example of SQL statement execution is as follows.
USER>do $systemSQL.Hi Allen,
A partner have decided to change the algorithms that were used to connect on it's SFTP, but our version of libssh2 don't match with the list of it's HOSTKEYS algorithms.
If i update the library with the last version without to be sure that it includes the old algorithms, i risk to break the connection for other cases.
all suggestions are welcome. Thx
KR,
Amine
Hello!
How I can send Synchronous request ?
For example when I cannot call another process until my first business process do not finish.
ClassMethod Main() {
set sc = FirstProcess()
//Dont start until first process finish
set sc = SecondProcess()
}
ClassMethod FirstProcess() {
Set sc = ##class(Ens.Director).CreateBusinessService("BusinessServiceName", .BService)
Set sc = BService.ProcessInput(BSRequest,.BSResponse)
}
ClassMethod SecondProcess() {
Set sc = ##class(Ens.Director).CreateBusinessService("BusinessServiceName", .BService)
Set sc = BService.You can use the %IndexBuilder class to perform index rebuilding using multiple processes.
Here is an example for the purpose of defining the standard index HomeStateIdx for the Home_State (state information of contact address) column of Sample.Person.
The steps are as follows:
1. Hide the index name to be added/rebuilt from the query optimizer.
>write $system.SQL.SetMapSelectability("Sample.Person","HomeStateIdx",0)
12. Add %IndexBuilder to the rightmost superclass of the class definition that defines the new index.
The task for a file on disk is to open it, find a keyword (unique) and then read the file line by line, starting with the line with this keyword, then find the next keyword (also unique) and read from that location etc. I would think ObjectScript classes should be able to do that, but the solution eludes me. I probably need to use FindAt to get a position, but ReadLine does not seem to have a position argument. Any advice?
I want to use AESEncode encryption, but it prompts a MAXSTRING error. How to solve it?
Most server-client communication on the web is based on a request and response structure. The client sends a request to the server and the server responds to this request. The WebSocket protocol provides a two-way channel of communication between a server and client, allowing servers to send messages to clients without first receiving a request. For more information on the WebSocket protocol and its implementation in InterSystems IRIS, see the links below.
Global mappings can be registered using the system class Config.MapGlobals.
The method to globally map ^Sample.PersonD in a database SAMPLES other than the default database from the namespace USER is as follows (example executed in a terminal).
USER>zn "%SYS"
%SYS>set ns="USER"
%SYS>set glo="Sample.PersonD"
%SYS>set vals("Database")="SAMPLES"
%SYS>set st=##class (Config.MapGlobals).Create(ns,glo,.vals)The third argument of the Create() method of the Config.MapGlobals class is passed by reference, so specify it by appending a period (.) to the variable name.
The goal is to identify programmatically all SOURCE namespaces on a server to which the routines are mapped. In the example below from the Namespaces page in Management Portal the answer would be USER. But some other namespaces on the same server could be mapped to a different namespace or even mapped to itself.
This code snippet prints all namespaces and source namespaces for their routines.
set statement=##class(%SQL.Statement).%New()
set status=statement.%PrepareClassQuery("Config.Namespaces","List")
set resultset=statement.%Execute()
while resultset.
I am sending an httpRequest from ObjectScript to a python server. I am not receiving a response in OS
OS config On the client side
// Create an HTTP request object
Set httpRequest = ##class(%Net.HttpRequest).%New()
// Set the server URL
Set httpRequest.Server = "http://127.0.0.1:8080"
// Set content type to JSON
Set httpRequest.ContentType = "application/json"
// Clear any existing entity body"{""name"": ""Lowell Buschert"", ""dob"": ""1970-12-09"", ""address"": ""XXXXX""}"
do httpRequest.EntityBody.Clear()
//Set httpRequest.
Hello!
How I can call my Business process - "process.ReconciliationPayments" from method. Like this.
{
s sc = $$$OK
s requestObj.provider="Provider"
s requestObj.processId=$SYSTEM.Util.CreateGUID()
q sc
}
s ftp=##class(%Net.FtpSession).%New()
s ok=ftp.Connect(server,user,password,port)
s ftp.Timeout = 100
i ok {
s ok=ftp.SetDirectory(directory)
i ok {
n files,file
s ok=ftp.NameList(directory,.files)
i ok {
f i=1:1:files.Count() {
s file=files.GetAt(i)
i (ftp.SetDirectory(file)) {
d ftp.SetToParentDirectory()
continue
}
s fname=$p(file,"/",$l(file,"/"))
s ok=ftp.Retrieve(file,.data)
I know we can use Do ^DBREST and EXTSELCT ^DBREST or EXTALL ^DBREST to recover the database. But now I just want to use Do ^DBREST to achieve database recovery through this method.
Any help would be greatly appreciated
In this paragraph of the article, here is an example of different records to explain how to fill in DirName、Globals and RestAll, but i don't know what is DUA1:[TEST3] ? This doesn't look much like dirname, like this /cachesys/mgr/test/. Can someone explain it? I would greatly appreciate it !