I am trying to make Caché perform certain actions depending on whether a particular property of the object was changed using triggers.
For example, say I have this class:
An object data model is that data or code is composed of modules that combine data and procedures that work on the data.
I am trying to make Caché perform certain actions depending on whether a particular property of the object was changed using triggers.
For example, say I have this class:
I am using a %GlobalStream to create as % stream.Object and writing that to a file but for some reason when I run that on the terminal I get <PARAMETER>zWrite^%Library.GlobalCharacterStream.1 and no file is created
I have tried the following here is my code and still get the same result any help appreciated
Is there documentation that states %Id() is supposed to be available in %OnBeforeSave()?
I am currently using it in this method without issues, but one of my colleagues is stating it is not supposed to be available for a new object at this point because the object has not been saved yet.
If you want to dynamically serve images as a property of JSON then there is no perfect encoding solution. One method used frequently is to Base64 encode the image. Whilst there are some negatives to doing this, such as data inflation, there are some positives to working with Base64 images inside the browser.
Let's say you have an image placeholder on a web page...
And you fetch a JSON message from the Caché server containing the image as one of its properties...
Hello, evrybody, I'm writing one project using CSP("OnPreHTTP"), and also REST angular. At the beginning I wrote purely on csp, then I decided to use angular for the flexibility of the client part. Now I can not design logging, I created a table App.Log with properties
Example :
set property.Name = element.LocalName
set property.Type = "%Library.String"
set property.Parameters = ???
Hi,
I am receiving a CSV file as Ens.StreamContainer using pRequest As Ens.StreamContainer
In the studio code, pRequest.Stream.ReadLine() returns following records when read in a while loop using pRequest.Stream.AtEnd = 0
Appt ID , Patient ID , Patient Name , Program , Appt Date , Appt Start
102 , 1002 , "Gene, Jill" , HTR , 06/06/2017 , 10:00
103 , 1044 , "Smith, John" , HTR , 06/10/2017 , 08:00
I am trying to read a csv file and transfer it to a XML file without storing the objects to a database I have this code here doing the reading and have another method transferring the object read to a file but the reading one reads fine when it comes to the converting one I run to problems nothing happens any help appreciated
Hello again and welcome to the next tutorial on this series: Part 4 - Sharing data across router methods. Here we are going to learn how to share a object containing data that is available for read across every router methods.
You're required to complete at least the Part 1 before entering this one. Still, this is supposed to be a really short tutorial, since there isn't much to be said about data sharing.
I am sending a file in Postman and receiving a status 200OK. but i need to get the response in the body too. I have Implemented the class %CSP.REST to get the %request and %response. There is no default method to invoke and post the content via %Response class. Can any one suggest me the sample code for that.
I have an xml file that I read into objects and I am trying to print that file back in nested xml anyone with idea on how that can be achieved or where I can read in order to achieve this, here is an example of what I am trying to do.
From this
<Root>
<FamilyMembers>
<familyName>
</familyName>
<Name>
</Name>
<Age>
</Age>
<Employment>
</Employment>
</FamilyMembers>
</Root>
To this
I have a class that has a list property, which contains a list of other objects, and I want to join against it in SQL.
Class Foo Extends %Persistent
{
Property MyBars As list Of Bar;
}Class Bar Extends %Persistent { Property Name As %String; }
Simply querying the Foo table, I see that MyBars looks like a $LIST, so I tried using a query with the %inlist operator but that didn't seem to work as expected. The following query produces zero results:
select bar.name from foo join bar on bar.id %INLIST MyBars
Hi-
I am running the latest version of Cache and am trying to use the Config.* classes in the %SYS namespace to be able to gather information from a cache.cpf file that was provided to me by a customer. The customer is running an older version of Cache which had a different Version number in the cpf file. Theirs is 2013.1 and mine is 2015.1.
My question is, are the Config.* classes backwards compatible. Can I use a 2017.1 version of Cache to read information from cpf file from a 2014 system?
Hi all,
I wonder if is possible to create a task object and this task calls to a Business Process (or business operation)
My attempt was:
Hello again! Welcome to the Part 2 - Handling payloads!
If you're new to this series, I'd recommend you to check out the Part 1 - Core concepts. You'll need a basic understanding about how Frontier works before continuing with the Part 2.
Hello.
The idea of this post is to introduce Frontier: An abstraction layer that allows Rapid REST development.
REQUIREMENTS:
Why?
Have you ever found yourself dealing with repetitive tasks like mounting objects, serializing them and eventually handling multiple errors for multiple cases? Frontier can boost your development by making you focus on what really matters: your application.
Frontier is made to stop you from WRITE'ing by instead forcing your methods to return values.
It's designed to make you code clean, and you'll see the why pretty soon.
This is the Part 1, where you'll learn he basics about how to work with Frontier. That means at the end of this part you should be capable of
creating GET requests without difficulties. Since this also serves as a way to introduce the framework, I'll be calling this part: Core concepts.
I need to convert the following XML file (with namespace) into an object in Ensemble. After processing the data, you also need to convert the object to an XML file (keep the namespace). During this time, the XML structure does not change, Only the data will change. How can i do it?
In which global cache class codes are storing in cache DB?
For example, Routine codes are storing in ^ROUTINE global.
situation: Need to read line by line and need to replace one string to another string in class files(.cls file) using programming.
Need to replace Property type in class files using programming i mean via programming to edit the class files
MonCaché — MongoDB API implementation based on InterSystems Caché
The idea of the project is to implement basic MongoDB (v2.4.9) API features for searching, saving, updating and deleting documents in a way that will allow the use of InterSystems Caché instead of MongoDB without changing the code on the client side.
Hi,
I am experimenting with Cache-Python binding. In the following piece of Python code
import intersys.pythonbind3
conn = intersys.pythonbind3.connection( )
conn.connect_now('localhost[1972]:SAMPLES', '_SYSTEM', '123', None)
samplesDB = intersys.pythonbind3.database(conn)
p10 = samplesDB.openid("Sample.Person",'10',-1,-1)
p10.run_obj_method("PrintPerson",[])
I am opening the 10th record of Sample.Person class and then I am calling an object method (PrintPerson).
Method PrintPerson()
{
Write !, "Name: ", ..Name
Quit
}
XDATA is used for a whole host of ISC libraries to store things like Zen pages, BPL logic and DTL transformations.
XDATA is the equivalent of XML config files of the JAVA world and JSON config files of the JavaScript / NPM world.
Whilst Atelier looks to shift source code to the disk, XDATA will remain a key component to source control our projects config / meta data.
I come across many developers who overlook XDATA, seeing it as an internal function of Cache and Ensemble and instead use globals to move meta data around, I've been there myself.
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.
SOLVED
tl;dr how can you tell if a number is really a string
The original question has been updated/improved.
Equality comparisons on floating point numbers will produce different results...
"1.1"=1.1 //is true!
"0.1"=0.1 //is not true :(
This second comparison can be fixed with...
+"0.1"=+0.1 // is true!
The problem is, what if we don't realise that a value is a stringy number, or just overlook implementing this defensive check.
One solution would be to lint check %Float properties and return types that should originate from a number and not a string, as discussed here...
Hi,
I have a process in which i call a rest operation in a while loop, get a response in JSON format of 50 issues, with paging, meaning this call will happen until the total amount of issues will be returned. each JSON is parsed into a proxyObject, and inserted to a list. later the entire list will be sent to an SQL operation which will write the data in the appropriate tables.
The problem i'm encountering, is when i use the "ASSIGN" action, with insert at a certain key (context.i=context.i +1 for each iteration of the loop), i get an Error that says that the value 3 is invalid key.
tl;dr I have discovered that using $THIS in a very specific way will make persistent objects go stale.
I found that it only happens when using $get on an array that contains the OID reference of $THIS. I assume that this is an unwanted feature and have raised a WRC. The problem can be recreated following the steps below, I have also posted the workaround that I am currently testing and looks to be working fine.
1. Create a persistent class...
Hi all,
I need to create a routine to modifiy some values in a global.
My first attempt was:
but if I use a *.bas file (cache basic script), I'm not able to use these commands ($Order and $Next) and I don't know how to translate theses words.
This is the first article of a series diving into visualization tools and analysis of time series data. Obviously we are most interested in looking at performance related data we can gather from the Caché family of products. However, as we'll see down the road, we are absolutely not limited to that. For now we are exploring python and the libraries/tools available within that ecosystem.
The series is closely tying into Murray's excellent series about Caché performance and monitoring (see here) and more specifically this article.
I know there are numerous Java libraries available to scan a PDF meta data, but is there a way to scan a PDF using native cache object script? We are looking to take a PDF from an external vendor, scan for meta data, create the HL7 message, and embed the PDF within the HL7 message.
Thanks
Scott Roth
The Ohio State University Wexner Medical Center
Here's one way to determine if a class is mapped (i.e. it is in a package whose definitions come from a database other than the default code database for the current namespace):
SAMPLES>w ##class(%Library.RoutineMgr).IsMapped("Cinema.Film.cls")
0
SAMPLES>w ##class(%Library.RoutineMgr).IsMapped("%iKnow.Objects.Source.cls")
1
SAMPLES>If you pass a by-ref second argument to IsMapped you can also discover what database the class definition is stored in:
I want to retrieve all the names of classes which are %Persistent in a namespace by COS.
Any suggestion, Thanks.