I am creating a custom message class. How do I define @name and #text fields?
this?
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.
I am creating a custom message class. How do I define @name and #text fields?
this?
Maven is a tool, hosted by the Apache Software Foundation, for building and managing any Java-based project. Apache Maven is the best source of information.
Managing a project, its dependencies, and life cycle can be a tedious task. Maven automates these tasks, making project management much simpler. Maven also defines a standard directory layout and provides tools for initializing projects. These tools employ project templates called maven archetypes There is a rich library of archetypes available.
Hello!
I am trying access each "name" tag in the xml-file down below and want to display them through the trace in the production:
<?xml version="1.0"?>
<staff>
<doc type="consultant">
<name first="David" last="Marston">Mr. Marston</name>
<name first="David" last="Bertoni">Mr. Bertoni</name>
<name first="Donald" last="Leslie">Mr. Leslie</name>
<name first="Emily" last="Farmer">Ms. Farmer</name>
</doc>
The code I have so far is this:
Hi,
I'm receiving in one of our interface a XML file as a %Stream.GlobalBinary, and in the source Application that produces this XML file, the user sometimes add a special character that force the XML file to have the header encoding to UTF-8, instead of ISO-8859-1 :
<?xml version="1.0" encoding="UTF8"?>
When my current interface tries to convert the %Stream.GlobalBinary into
While creating my latest examples for the JavaContest I faced the need
to communicate with my code from a program in IRIS to my Java code.
Communication with |CPIPE| worked as READ or WRITE but not both?
In the Documentation Named PIPEs are explained rather shortly.
"Once open, a pipe acts like an ordinary device." Not so precise.
I failed to achieve my expected READ/WRITE as TCP would offer.
Has anyone a working example to demonstrate it?
Any suggestion is welcome.
I found a workaround for my actual case.
Though I'm not so happy with it.
I have received 2 errors while publishing Patient data to repository. Message viewer displays like below and the Application log found bold content.
Could you please help me on this to resolve the errors.
An error occurred with the web application.
It has been logged to system error log (System Operation>System Logs>Application Error Log).
"<METHOD DOES NOT EXIST>OnPage+42^EnsPortal.MessageContents.1 *%Id,HS.FHIRServer.API.Data.Request : CSP Error"
Business Operation Event logs displays "ERROR <Ens>ErrRequestNotHandled: Request message '3@HS.FHIRServer.API.Data.
Based on the successful solution for my 2nd contribution to the Contest
I used an adapted version for this package. And have some findings I'd like to share.
Multiple communication steps over CPIPE may take time.
You won't recognize it on a fast machine. But a slower box with
Windows + Docker Desktop + your browser (and more) is neither
"Speedy Gonzales" nor a "Road Runner". 🙂
First observation you launch your OS command and see NO result
On the console, you just sit there and expect a reply.
Establishing the Connection to IRIS is a typical case.
Jour redirected Output is just empty.
When using INSERT OR UPDATE command,
How does the command know if the row exists?
A tool (^GLOBUFF utility) is available to check the database cache usage for each global variable.
You can run the utility directly or programmatically in the %SYS namespace.
Here's how to run the utility directly:
Hi community members!
Recently a customer ask me about a problem that detected when they were trying to send a post call to an external HTTP service, this service has changed and now it redirects to another URL, so they have setted to true the FollowRedirect parameter (setted to false for POST calls by default), what is the problem? They are sending a custom header in the post call and after the redirection this value is deleted.
I've reviewed the code of %Net.
I wanted to provide a heads up of an improvement in how we generate and call method code in IRIS 2023.1.
A class in IRIS is composed of two main runtime components:
I was recently asked whether we have a function to convert LDAP date time stamps into $HOROLOG format or other formats and the answer is not at the moment, but there is a simple method to do the conversion.
Let us look at the facts and figures involved...
Hi everyone,
today I'm asking your help with an issue related to the response messages sent from my production to a client software, such as Postman or SoapUI.
In the last few days I've been unable to view the responses received from my production in Postman, even if I was able to do so earlier. I'm sending the request to a remote server reachable via a Putty tunnel.
I'm currently testing this simple POST message:
{
"name": "John Doe",
"email": "johndoe@example.Hi folks,
I have published a new package on OEX.
In short, it is a string datatype that support various configuration options and flexibility.
Here in %SYS, we have already examined users, resources, and roles. Now that we know how to set all of that up, we should give it a purpose. Next we will talk about applications! As you may expect, we will see various identical class methods defined here that we have seen in the previous classes. However, some of them will have some tiny yet significant differences.
This applies to embedded and dynamic SQL queries in Caché ObjectScript. If I attempt to terminate the process via Management Portal, nothing happens. Neither does Ctrl C nor closing the terminal window in which my program is running, nor setting a stop flag in a global which is read by the program on each loop iteration. The only way to stop the query appears to be restarting the Caché server (which is running locally on my PC).
Information on properties defined in a class can be obtained using the following system classes:
%Dictionary.PropertyDefinition
The code description example is as follows.
Class ISJ.Sample
{
ClassMethod getPropInfo(classname As %String)
{
set cls=##class(%Dictionary.ClassDefinition).%OpenId(classname,,.status)
if $$$ISERR(status) {
write "Specified class does nt exist",!
quit
}
set x=cls.Properties
for i=1:1:x.Count() {
// Get property info (%Dictionary.I am making a POST request to an API. In the case of an error, I don't know what parameters the response JSON will contain (they will change depending on the error). I am converting the response stream to an object but then I need a way to loop through all the properties and access their values. The following code is making the POST request, reading the response, and trying to add all the error messages to an array. But I can't iterate over the properties of the tProxy.errors object because it is a %ZEN.proxyObject. Is there a better way to do this?
Set tSC=.Adapter.
ObjectScript allows you to pass any number of arguments using arrays. Do it by adding ... after the argument name.
An example is as follows. In the example statement, the argument information is set in a global variable (a variable stored in the database) so that it can be easily checked after the method is executed.
Class TEST.ARGTEST1 Extends %RegisteredObject
{
ClassMethod NewMethod1(Arg... As %String) As %Boolean
{
kill ^a
merge ^a = Arg
}
}The result of running it in the terminal is as follows.
USER>DO ##class(TEST.Hello community,
I want to iterate through a defined collection/list of numbers for example 1,3,4,5 in my DTL.
Something like
Hello everyone!
I have manually created a REST-service that receives incoming HTTP-GET calls together with an URL-map. As shown below:
{
<Routes>
<Route Url="/testGet" Method="GET" Call="Handler" />
</Routes>
}
{
set Class = ##class(Ens.Request).%New()
set status = ##class(Ens.Director).CreateBusinessService("TestService", .instance)
set status = instance.OnProcessInput(Class, .response)
if $ISOBJECT(response)
{
write response.
It's a feature of ObjectScript (perhaps widely known, perhaps not) that if you open the same object ID multiple times, you end up with the same OREF. For example:
USER>set obj1 = ##class(Sample.Person).%OpenId(1) USER>set obj2 = ##class(Sample.Person).%OpenId(1) USER>w obj1,!,obj2 1@Sample.Person 1@Sample.Person
Generally speaking, this is an important feature - you won't end up accidentally modifying the same record via multiple paths and losing some of the changes.
I am currently debugging a piece of code relying heavily on macros. I am using breaks in the method to then check the values of macros and object properties as I go. However, any time I invoke a macro within a break I get an error. To get around this I am converting the macro calls into the underlying code. Some of these macros have messy translations and this is somewhat time consuming. Is there an easier way to access macros from within a break?
In the sample below, an image file is encoded into a Base64 string in a class property, saved, decoded again with Base64, and restored to another file.
【Usage class】
Class User.test Extends %Persistent
{
Property pics As %GlobalBinaryStream;
}
【When importing】
set x=##class(User.test).%New() // create a new object
// prepare an image
set file=##class(%File).%New("c:\temp\Mii.png")
do file.Open("RUK\BIN\")
for {
if file.AtEnd=1 quit
// Convert image to Base64 format in chunks of 1024 bytes
set cnt=file.Try a hands-on exercise in the language of your choice to get familiar with the multi-model architecture of InterSystems IRIS!
These recently updated exercises are available in ObjectScript, Python, Java, and .NET.
Hi All,
is there any way how to hide or remove storage "Histogram" section in the file with persistent class definition, but keep the data both in globals and sql table?
The reason is that we use on-premise version control system and since the data is sensitive, it cannot be uploaded along with the files.
.png)
I have already tried "NoExtent" keyword, but that does remove the sql table and just keeps the data only in globals. The only solution I have come up with so far is to remove all the "property" sections from storage in file everytime before committing changes.
Hi Community,
.png)
to learn quickly and in total autonomy on IRIS, I offer you some links which can help you in this beautiful bicycle ride rich in discoveries:
The related package avoids adding %JSONAdaptor to each class but uses instead
SQL functions JSON_OBJECT() to create my JSON objects. With this approach, you can
add JSON to any class - even deployed ones - without any need for change or recompiling.
The trigger was the Export of M:N relationships as JSON objects or arrays.
Hi everyone,
Today I have a simple yet potentially valuable question: How can I begin a new line of text within $$$LOGINFO or $$$TRACE?
For instance, if I need to display a long log message within the visual trace, is it possible to do something like this:
$$$LOGINFO("object: 'This is a try'"
_"this is the second line with an example parameter: "_x
_"this is the third line with an example parameter: "_y
")Does anyone know if such a feature exists? It has the potential to greatly enhance code readability and layout.
Thanks :)
Currently I have a program that is going to be used to compare global nodes between namespaces. Using nested FOR statements I am stepping through global nodes and comparing between the namespaces, if the global values are different I then parse the node comparing each delimited segment.
This is working.
I want to now be able to set what global I am in as a variable to expand on this concept.
Program architecture
1.Initializing program that has user prompts to change starting nodes. This program contains the FOR nests to step through nodes.