hi world, how can i have access to the BPL set rules in programming ?
for information: all logical rules are stored in routine data base, but i don't know how to have access to its corresponding name space.
thank you for helping
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 world, how can i have access to the BPL set rules in programming ?
for information: all logical rules are stored in routine data base, but i don't know how to have access to its corresponding name space.
thank you for helping
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.
How do we need to set a flag with quit command and what is it share some example?
Is it possible to execute a sql update statement from objectscript? This code isn't working for me.
Set tSQL = "UPDATE table Set Status = 'Completed' WHERE ID in (1,2,3,4)"
Set tStatement = ##class(%SQL.Statement).%New()
Set tSC = tStatement.%Prepare(tSQL)
If I write my dynamic sql to the event log, copy and execute it in the Management Portal, it works fine.
These Globals are usually cleared out as part of the startup/shutdown processes. If your server never reboots how would you clean these out?
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...
https://community.intersystems.com/post/compilation-gotchas-and-request-change
Is it possible to dynamically adjust the RetryInterval andFailureTimeout settings in a BPL?
I've got a business process that calls a web service operation to get a session ID from an external system. There is a string property returned in the body of the response that indicate an exception occurred in the external system. I have code in the BPL that examines the property and sets the status property to an error status when that occurs.
Depending on what the value is I want to adjust the RetryInterval and FailureTimeout values used in by the system when the ReplyCodeActions is set to E=RD.
Good afternoon -
I'm in the process of learning to make COS calls to REST-based web services and while I am having success, I'm struggling on how to parse out the results (I admit I'm very green at this):
Here's the code retrieving the JSON response:
w !,"Get the JSON"Set
This has Result as a Library.DynamicObject.
I can then write out the response using:
.
This works, I can see the response is valid and what I want. Here is the JSON returned (de-identified):
Hello everybody.
What I have is a criteria how to select "my" strings. What I need is to replace all of them with macro calls (using the same strings as arguments) in all classes of current namespace.
I was ready to write straightforward code, but at the last moment decided to ask the community: maybe I've overlooked a smarter option?
Any comments and advices would be great appreciated.
Hi, folks!
I'm sending emails with %Net.MailMessage.
How can I add a new line for the email body?
The code is:
dim msg as %Net.MailMessage = ##class(%Net.MailMessage).%New()
set msg.Charset="UTF-8"
do msg.TextData.Write("Dear "_Username)
do msg.TextData.Write("Line1")
do msg.TextData.Write("Line2")
Dear UserLine1Line2
How can I get:
Dear User Line1 Line2
I worked through the Community for proposals to provide end users
in an easy way with data formatted as EXCEL sheet.
There is a great article Tips & Tricks - SQL to Excel
there's an important message embedded: "EXCEL can interpret HTML tables and display them as usual"
Where's the light weight export to EXCEL ?
Good old CSP is well equipped to produce HTML tables accepted from EXCEL as input.
With modern Browsers you don't even need <head>and <body> tags.
So the required code around your SQL result set is really slim.
And you are free to add any formatting you need either by HTML or in SQL.
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
Has anybody defined their own Cache ObjectScript (COS) commands and symbols? Is it even possible? For a list of currently used commands and symbols please use the following link.
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS
I use %SQL.Statement. The original column names are not contained in the metadata.
Sample query:
SELECT column1->name as name, column2 age FROM sample.table
How to get:
Hello!
Intersystems is a fascinating yet niche marketed. We are using it, but we struggle to find good developers to join us to work on Caché or Ensemble products.
Who is interested into joining us? the job will be in Geneva, Switzerland!
For more information, please drop me an email to: erika.stegagnini@ch.randstad.com or call me directly +41 58 2015408.
Thanks! Erika
Good day, every process in my software is about to update 3 specific globals in row when the process is called to do some job. I need to guarantee that during updating of those globals with multiple processes there is only one process that is actually working with those globals. Moreover I need my globals unreadable if other process is in critical area.
Example:

(for example globals: ^data1, ^data2, ^data3 are critical area)
Should I use somehow function $LOCK() or there is another way how this can be done?
I am currently working on a issue with WRC on one of my Inbound SQL Adapters not returning all the records it should be. If I looked at the count of the records in Ensemble and compare it to that of a Microsoft SQL View, Ensemble seems to be off by a few records here and there. I am using a full dynamic select statement in my settings of the adapter.
Hi!
While i am trying to write a data i am getting a error as "<PROPERTY DOES NOT EXIST>zFile+15^User.zKQRest.1 *value,%Collection.ListOfObj" but there are values stored in it. How can i break it write it separately.
Hello everyone .
I am trying to update a setting of an operation directly via the code of a business operation.
Concretely, my customer want a counter for the number of calls to the operation and the possibility to redefine the point of this counter.
Good day,
I need to find out if it is possible somehow to receive actual linux TIMESTAMP for example with $NOW() or other functions.
I was trying to recalculate it with $NOW() function, but without success. I would like to simulate Redis TIME command in COS.
My tryings:
USER > set time = $NOW() USER > w (($PIECE(time,",",1)*86399) + $PIECE(time,",",2)) 5573319043.403186
But in Redis it is:
> time 1) 1502471158
On web page: http://try.redis.io/
type "time" + enter. And it will results as short documentation says: https://redis.io/commands/time
And this behavior I would like to implement in COS.
I have a list of %Library.ArrayOfObjects . Each of list elements has some properties. I have to sort list by one of its objects properties. Is there a predefined method to doing that? (quicksort maybe?)
In a previous exercise, I was able to show the power of Caché.
A medium-designed set of interdependent tables with some GB of data.
URLs cross reference over some million pages resulting in ~3 billion records
Competition was between
Criteria were Speed + Storage consumption
I composed a customized loader fed over a "raw" TCP connection
Mapping the "objects" into the final table by directly writing to Global Storage.
Hi, folks!
There is an interesting discussion in the neighboring topic which raises a question for me: is there any reason to have %Status as a return value for COS method?
Major difference between GOTO and do command?
In reviewing the documentation found here, it states that there is an Attributes property. Since this is an array, I was wondering how I would go about traversing through the array to review what attributes are available on the file.
I am running a ZBREAK trace on a legacy FDBMS application that uses arrays but rather than displaying the array value contents, I am seeing logs similar to the following.
Trace: ZBREAK SET LINE=Array Val at BIOPWR+6^BIOPWR
My ZBREAK trace settings are as follows:
ZBREAK /TRACE:ON:"/somedir/trace1.log"
ZBREAK *LINE:"T"
The 'LINE' array has a single integer subscript and some string data. The subscript is sometimes calculated using arbitrary calculations such as S LINE(I-33)="BLAH BLAH BLAH" This makes the code very difficult to read and debug.
Hi community,
I have some constants hardcoded in my class as parameter values, and those constants are referenced in many places in my module. Now the need has arisen to provide different value for those parameters depending on some context. Is it possible to create some sort of accessor method for the parameter (like it is possible for properties), or do I need to perform a thorough refactoring?
Thanks.
Jiri
Hi,
How can I read the stack of another process?
I know about ^JOBEXAM, but I only know how to use through terminal, and I need to get a string, or at least do a method that returns me a string
For example:
I have process A and B
B monitors process A at each second.
B logs information about process A in a table
Informations about lock I get through %SYS.LockQuery and the process through %SYS.Process
How can I get stack of process A from process B to log in the table?
Cache 2015.2.1
Thanks
Good day,
I would like to know how to detect in Caché ObjectScript if data saved in string is number and furthermore, if it's type is integer.
I maybe found a solution:
set value = "44.2d3"
try{
set status = $INUMBER(value,"")
if ('$FIND(+value,".")){
w "your variable: '"_value_"' is number and integer"
}else{
w "variable is number but no integer"
}
}catch(e){
w "variable is not number"
}
But I don't know how to do it correctly or if there exist better solution in COS (or maybe my solution is incorrect).
Thanks in advance for answers.
Hi, folks!
Suppose I have a CSP app, which provides some service.
And the code of my App knows the name of the CSP App in form: /myappname
How can I programmatically obtain the URL for CSP apps to send the full qualified link to the users(e.g. via email) of my app?