Introducing non-persistent messages. eXpert-to-eXpert

Background

InterSystems Ensemble as a tool does a lot for the Developer. One of the nice features is the Message trace utility. It shows a message flow diagram. The diagram shows the progress of the message processing real time. You can get many-many useful information from the production. In any case, someone needs to find a bug in a production implementation, without the Message trace utility it could turn into a real nightmare. 

On the other hand, keeping message “traceability” is not for free. A heavy loaded production can very quickly run out of resources just because of the house keeping functions of Ensemble. House keeping functions such as maintaining message header, log entries, message queue generates a significant load on the Caché database used by Ensemble.

This article is about to show how to force Ensemble work more for the everyday life, instead of being prepared for “any-time-debugging”.

This is an eXpert-to-eXpert article. Therefore, I assume the deep understanding of Ensemble.

0 3
0

comments

908

views

+ 9

rating

Hello, our customer, large industrial company, is considering modernizing their old CSP application so it can run on multiple client device types, using responsive design.

They have a lot of experience with CSP and some ZEN.

They are new to REST and have some limited knowledge of javascript - perhaps not enough to the extent used by client framework.

Does anyone have a framework or a set of templates that you would be willing to share?

Thank you!

Dan Kutac 

Last answer 16 May 2016 Last comment 16 May 2016
0 0
507

views

+ 2

rating

Hello,

I'm trying to connect to a Caché server from Atelier; the Caché server is 2015.x.

The address and port I'm trying to connect to is the SQL gateway server; and I get, each time, an "unexpected end of file from server".

Note that unfortunately, for the moment, I connect as _system... And the Caché install has the default privileges.

What am I doing wrong?

Last answer 13 May 2016
0 1
0

comments

297

views

+ 1

rating

This is a bit weird.  I'm trying to use `DATEDIFF()` to calculate the time since the last message on an interface.  For some reason, when no messages are received, the number steadily decreases.  This is the opposite of what should happen.  Here is my current query and a few sequential result sets:

SELECT getDate() as now, max(TimeCreated) as latest, DATEDIFF (s,getdate(), max(TimeCreated)) as difference
FROM EnsLib_HL7.Message

 

now                  latest               difference  
-------------------  -------------------  ----------  
2016-05-13 11:05:31  2016-05-13 08:51:16  9945
2016-05-13 11:08:16  2016-05-13 08:51:16  9780    
2016-05-13 11:08:36  2016-05-13 08:51:16  9760 

Last answer 13 May 2016 Last comment 13 May 2016
0 1
355

views

0

rating

Hi,

If you want to import data from a mySQL export file (exported with mysqldump), you will find here a little script that could help.

Only the INSERT commands in the sql file are executed into Caché. Indices are not computed for better performance.
%NOINDEX, %NOCHECK and %NOLOCK are generated on each INSERT line.

Currently, the file can not contain a "),(" pattern inside the values part of the INSERT command. If this is the case, the line is skipped. This feature may be implemented in the extractValuesList method.

Feel free to improve it as needed. Unfortunately it's not guaranty bug free for the moment!

mysql.tools.xml_0.zip

Last comment 13 May 2016
0 2
226

views

+ 2

rating

Hi -

I've been trying to create a "sub packaged class" (i.e. TopPackage.SubPackage.Classname) but the current version of the "New Class Wizard" doesn't seem to allow me to do this.

If I try to specify a \project\subdirectory in the "Project" or I try to specify a Package.Subpackage form in the "Package", or I try to specify "Subpackage.Classname" in the "Class Name" they ALL fail to give me a "next" or "finish" button that works (the buttons stay greyed out)

In the  case of the multi-level project, it tells me that the class name can't be empty, in the other two cases, the wizard says I can't use a "/" or "-" or "." in the value

How SHOULD I be able create a subpackage class?

(as a work around, I created the class in Studio, then copied it via Atelier's Server Explorer interface into my project, and that works fine, but clearly isn't the right way to do this) 

Last answer 12 May 2016 Last comment 13 May 2016
0 1
213

views

+ 1

rating

Hi -

 

I'm trying to figure out what is the best (or at least pros & cons) on how to manage login accounts in a multi-tenant SaaS web based application context.

Assume that a company is designing a collections of web based applications that they will be selling as "services" to their clients, and that these clients will each have their own "users" and "customers" that will be logging into these services.

In setting up these login accounts for the "users/customers" of the "clients" of the "company", does setting up a unique domain/user-pool context for each "client" make the most sense? And if so, when deploying updates to the applications, would each domain/user-pool context be replicated environments that would each need to be updated?

(I'm trying to figure out what makes any sense in terms of web-login-account management and ease of top-level administration)

Last answer 10 May 2016 Last comment 12 May 2016
0 2
222

views

0

rating

Hi!

I believe the simplest is (to work with csv delimited by ";"):


set file = ##class(%File).%New( "data.csv" )
    set sc = file.Open( "R" ) 
    if $$$ISERR(sc) quit    ; or do smth

    while 'file.AtEnd {
        set str=file.ReadLine() 
        for i=1:1:$length( str, ";" ) {
            set id=$piece( str, ";" ,i ) 
            write !, id  // or do smth
        }
    }
    do file.Close()

Possible options:

different variants of error handling with sc code.

Embrace while loop into try/catch block.

And what's yours?

Last comment 12 May 2016
0 6
2356

views

0

rating

Often when debugging COS code you get an error message such as '<UNDEFINED>test^routine *test' so the first thing you want to do is to take a look at this code and see what it is doing. From the command line you can:

ZLOAD routine ZPRINT test

Which means splitting the $zerror information into the routine name and the line and adding the zload/zprint commands. Also you often want to view the lines above the one where the error happened as this gives you some context of how you got to this line, using ZPRINT you could 'ZPRINT +1:test' but that may display hundreds of lines.

Since 2013.1 you can use ZZPRINT as follows:

ZZPRINT "test^routine":10

Which will print the 10 lines before the 'test^routine' line, so here you can cut/paste the line reference directly into the command and you can specify the number of lines before or after using this syntax where both the before or after can be blank

Last comment 12 May 2016
0 5
454

views

+ 5

rating

I have some logging code that outputs task status information to a log file. I would like to make the log available for reading while it is open for writing. The file is opened using the "L" option (Lock):

Open tLogFile:"WASL" Set tLogOpen=1


My intent was to prevent multiple processes from accidentally writing to the file and having messy output. Unfortunately, if the process is taking longer than expected, one can not simply open the log file to figure out what is going on because the "L" lock prevents the file from being opened for reading as well as writing.

Is there a simple way to enforce a single writer but allow many readers?

I am thinking that I may just have to take out a regular COS lock when opening the file, and release the lock when closing the file, but if I can just change the flags on the Open command, I would rather know how to do that.

Thanks,

Derek

Last answer 11 May 2016
0 1
0

comments

185

views

0

rating

I'm using Atelier 1.0.145 on Windows (x64). When I open the Help menu from the menubar the final entry (About Atelier) has a huge version of the Atelier icon alongside it. This distorts the menu. I can't post a screenshot here because my simplistic screen capture tool causes the faulty menu to close. But the large icon I see is also (correctly) displayed on the About box itself

Last comment 11 May 2016
0 2
278

views

+ 1

rating

Hi -

I would like to change the initial text that is generated by the New Class wizard in Atelier, but I'm not sure if I can or where to go to make the modification. I have a specific format for initial classes, and the wizard generated code isn't cutting it for me. I know it's trivial to take the generated text and just modify it, but if I could only have to do that in the wizard, that would be better.

The more generalized question is, which wizard output can be safely changed without fear of losing the change on upgrade, and where are these?

Thanks

Chip

Last answer 10 May 2016 Last comment 11 May 2016
0 1
181

views

+ 1

rating

Configuration

Cache 2016.2 running on fully patched minimal CentOS 7 install. No Firewall.

Atelier running on Centos 7 Desktop. No Firewall.

 

I was able to build and compile classes from Atelier.

When I try to run a routine or some class code from Atelier I get an error.  It tells me to look at the Network Activities view.

When I do that I see the following:

Last answer 10 May 2016 Last comment 11 May 2016
0 1
371

views

+ 1

rating

This question came on the Ensemble in Healthcare email list. It's a great question. I'm working on an answer, but am posting it here to get any other input. I'll also address the option of using %CSP.REST.

Hello everyone,

 

Using Intersystems Healthshare/Ensemble, I am trying to make a RESTful Interface between Android/iOS app and Cache database. I have some queries and I am unable to find where exactly I can get any resources on them.

Last answer 10 May 2016 Last comment 25 March 2016
0 2
6182

views

+ 2

rating

Greetings! This article describes yet another simple way of creating installers for the solutions based on InterSystems Caché. The topic covers applications, which can be installed or completely removed from Caché with one action only. If you are still documenting installation instructions that have more than one step to do to install your application — it’s high time you automated this process. 

Last comment 10 May 2016
0 6
980

views

+ 5

rating

I am trying to execute a system query. - %SYS.Journal.File_Search()

The Query is looking for a Journal File Name and a String.

However, the Query line accepts no parameters. - Query Search() As %Query(ROWSPEC = "Offset:%Integer")

But in the SearchExecute method if checks for File and String.

ClassMethod SearchExecute(ByRef qHandle As %Binary, String As %String, FileName As %String . . .
{
                i $g(String)="" q $$$ERROR($$$JournalFileSearchUndefined)
                i $g(FileName)="" q $$$ERROR($$$JournalFileUndefined)

Can anyone help me understand how the String and FileName is passed into the query?

 

Last answer 9 May 2016 Last comment 10 May 2016
0 2
477

views

+ 1

rating

Our company is looking for someone with expert object script skills and experience developing with REST using Caché. We have an existing application that currently supports a mobile application and a web application. The API is up and running but we need another developer to add new features and keep up with demand.

Experience with Amazon AWS is highly desired as the api is running on Windows in EC2. Familiarity with GitHub is also required.

Pay can be negotiated on a per hour basis after you provide an estimate for the time required to complete a given feature.

We are looking for 25-30 hours per week. If you are interested, please contact developers@pionetix.com

 

0 1
0

comments

203

views

0

rating

I was writing a routine that called some class methods and when I typed in ##class( and the package, there was a drop down list of all the classes that match that package but when I selected one of the dropdown entries it added the package name again.

For example if I enter ##class(dim.

I am presented with a list of classes in the dim package but when I selected one of them,(dim.OccupationList), what ended up in the editor was

##class(dim.dim.OccupationList

Last answer 9 May 2016
0 1
0

comments

233

views

+ 1

rating

Hi!

Want to share with you code snippet of try catch block I usually use in methods which should return %Status. 


{ 
 try {
  	$$$TOE(sc,StatusMethod())
 }
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()
 }

Quit sc 
}

Here $$$TOE is a short form of $$$TROWONERROR macro.

Inside macro StatusMethod is any method you call which will return %Status value. This value will be placed into sc variable.

In case of sc contains error execution will be routed to try catch block. You can wrap any Status methods calls in your code if you need to catch the errors coming from them.

In try catch block I place my logic and have to mandatory calls:

s sc=e.AsStatus() to get the status of error.

D e.Log()  - to place all the stack of error to standard Application Error log which you can find in Management portal on this page

Last comment 9 May 2016
0 7
1185

views

+ 2

rating

The purpose of this post is to raise the profile of a powerful mechanism that has long been available to us, and to open a discussion about ways in which it can be used or abused.

You can read more detail about the mechanism here. To summarize, your class definition can use the Projection keyword to reference one or more projection classes. A projection class can implement methods that get invoked at key points in the lifecycle of your class.

A projection class must extend %Projection.AbstractProjection and will typically implement at least one or the following methods

Last comment 9 May 2016
0 10
798

views

+ 7

rating

I have a class which, in the previous instance, was able to extract metadata field names and data from a text file, and load this information into a domain. I am trying to run this in the field test instance, but it is not loading the metadata - only the field names. I am not getting an error, but the data is not loaded.

The few changes I made to the original class:

Previously, this class also ran iTables. I commented all that code out.

To create the domain, I replaced the line:

  set tSC = ##class(HSTA.DomainExpert.utils.DomainUtils).%CreateDomain(dname,.domoref,ikcfgName)

with two lines:
  set domoref = ##class(%iKnow.Domain).%New(dname)
  set tSC = domoref.%Save()

Also, the newly created domain does not show in the iKnow Architect "Open" menu, but it IS available in the Knowledge Portal

Last answer 8 May 2016
0 1
0

comments

226

views

0

rating

I have a scenario where I am calling a business operation which populates  and returns an EnsLib.SQL.Snapshot via dynamic SQL to a Business Process. I then want to iterate over this snapshot and call a RecordMap Operation to write those records to a delimited file.

Is this the correct way to do something like this? If so, does anyone have a sample which illustrates its correct usage?

When the snapshot is returned I save it into a context variable with:

set context.Snapshot=callresponse where the pOutput variable of the operation is set to EnsLib.SQL.Snapshot.

Would I then use a While block where the condition is context.Snapshot.Next() ? This seems to give an error

Last comment 6 May 2016
0 2
0

answers

267

views

0

rating

We are in the process of putting a new UI on the existing product documentation, including a mobile-optimized view. We also plan on releasing additional "solution based" documentation that is targeted at common usage scenarios or important configuration tasks.

We are interested in your feedback on our current product documentation - what you like and dislike and especially what changes you would expect to see to make it as useful as possible.

Last comment 6 May 2016
0 9
606

views

+ 3

rating

You may experience errors executing Java programs that rely on the JAVA_HOME environment.

For example when Create PDF from this pivot in DeepSee or in this case, outputting a Zen Report as PDF.

You can verify the PDF generation configuration by clicking on the Verify Now button on the Management Portal System > Configuration > Zen Report Settings page:

  

 

Outputting a Zen Report as PDF causes an error, for example ZENApp.MyReport.cls in the SAMPLES namespace:

 

Using the URI Query Parameter $LOG=1:

0 1
0

comments

251

views

+ 1

rating