Eduard Lebedyuk · Feb 22, 2020 go to post

Supported platforms for Ensemble are listed here, for InterSystems IRIS here.

If you don't want to use RHEL you can choose between:

  • Ubuntu 16.04 LTS
  • Oracle 7
  • SUSE Linux Enterprise Server 12

I prefer Ubuntu.

Eduard Lebedyuk · Feb 20, 2020 go to post

1 sql request per property, or only one "big" sql request ?

How are you planning on merging distinct requests? One case I've seen where you need something like this is when you want to get a valid subset of filter values (which would return 1+ rows) for each next filter, but in the end all filters are still combined into one query.

You need to decide on:

  • what predicates are allowed (=, %STARTSWITH, <, >, LIKE, IN, ISNULL, BETWEEN)
  • what logic operations are allowed (OR, AND, NOT)
  • are nesting and brackets allowed
  • is it free form (auto constructed from metadata) or fixed (from a pre-set list of properties).

After that on a client you construct filter object, validate and parse it on a server and execute the query.

If you're not satisfied with performance, server-side part can be tweaked without modifying the client.

what's the disadvantage of using lot of indexes ?

INSERTS/UPDATES are slower, more space is needed.

Eduard Lebedyuk · Feb 19, 2020 go to post

There could be two issues:

  • Race condition
  • SQL error

For race condition you need to compare the time when the query is executed to the time when Workflow objects are created.

For sql construct query as a string and trace that.

Eduard Lebedyuk · Feb 18, 2020 go to post

PartoNo is present thrice in your XML so you should correspondingly set

Property PartoNo As %String;

  three times. One time it also an attribute so add XMLPROJECTION="attribute". Docs.

Eduard Lebedyuk · Feb 17, 2020 go to post

You can replace

do myStream.Rewind()
set len = 32000
While (len > -1) {
    set sRead = myStream.Read(.len)
    do httpRequest.EntityBody.Write(sRead)
}

With

set sc = httpRequest.EntityBody.CopyFrom(myStream)
Eduard Lebedyuk · Feb 16, 2020 go to post

Tasks contain session reference so you can simplify your query to:

SELECT
TaskStatus_Request As ID
FROM EnsLib_Workflow.TaskResponse
WHERE TaskStatus_SessionId = ?

For debugging: add hang 1 before executing SQL. What happens?

What do you want to do with ID?

Eduard Lebedyuk · Feb 16, 2020 go to post

im still not able access all values for example :  

XML import must end successfully before you can access parsed object.

As the error states, do you have TruLaser.Order class and is it compiled?

Eduard Lebedyuk · Feb 15, 2020 go to post

Great project, @Henrique.GonçalvesDias!

Sent you a small pr.

I have three questions:

  1. Why CSP instead of REST? It doesn't seem too highload of an app, being an admin tool essentially, so I just wonder why you decided to go with CSP.
  2. Let's move filtering to the server. Currently only the last 200 messages can be retrieved.
  3. Are there any plans to add visual trace? Our default visual trace is great, but when a single session exceeds 300-500 thousands of messages it's not as responsive. So I've been searching for a enhanced tool for session viewing.
Eduard Lebedyuk · Feb 14, 2020 go to post

Check xmlStatus, it's an error:

ERROR #6237: Unexpected tag in XML input: RawMaterialThicknessUnit (ending at line 7 character 29).

You need to either specify all properties or define this parameter in both classes:

Parameter XMLIGNOREINVALIDTAG = 1;
Eduard Lebedyuk · Feb 13, 2020 go to post

Ensemble uses $$$GetLocalizedName macro to get localized settings names.

You can add caption directly:

set ^CacheMsg("EnsColumns","en-us","HelloWorld")="Hello World"

Where HelloWorld is a property name, value is a caption and en-us is a session language.

It should work like this:

ClassMethod Add()
{
    quit $$$Text("@HelloWorld@Hello World", "EnsColumns", "en-us")
}

but for me it doesn't set the global. Not sure why.

Eduard Lebedyuk · Feb 9, 2020 go to post

As other commenters have stated you can use Python Gateway to drive Python process, in that case check this article, the Data Transfer section specifically. Also join our MLToolkit@intersystems.com usergroup - it's focused on AI/ML scenarios.

I'm a user of Python Native API so I can give the following advice. There are two cases here:

  • You need to iterate the result set - in that case you may want to call %Next() and retrieve values as you go.
  • You just need a complete dataset for downstream processing (your case). In that case yes, serialization is required.  I see two ways to do that: JSON and CSV. If the size of the dataset is small you can use JSON, no problem, but (I haven't run any tests but fairly sure) CSV serialization can be faster and less CPU/Memory intensive.
Eduard Lebedyuk · Feb 8, 2020 go to post

Looks like this is not possible by default:

You can use this trivial workaround:

set nl = $c(13,10)
set replace = "*"
set search = "MRN"
&sql(DECLARE C1 CURSOR FOR
     SELECT REPLACE(%iFind.Highlight(REPLACE(Text, :nl, :replace),:search), :replace, :nl) ...

And as long as your text does not contain replace sequence it should work.

Eduard Lebedyuk · Feb 6, 2020 go to post

The reason I say this is that the method has extra parameters that don't correspond to the SQL %Fimd.Highlight SQL function.  

What do you mean? Highlight method signature:

ClassMethod Highlight(pText As %String, pSearchString As %String, pSearchOption As %String = {$$$IFSEARCHNORMAL}, pTags As %String = {$$$IFDEFAULTHLTAGS}, pLimit As %Integer = 0, pLanguage As %String = "en", Output pSC As %Status) As %String [ SqlName = Highlight, SqlProc ]

Shows that it is available in SQL context (bolded). All classmethod arguments (except sc) can be passed from SQL.

Eduard Lebedyuk · Feb 6, 2020 go to post

Try double quotes inside:

SELECT %iFind.Highlight(Text , :pSearchString , ,'<span style="background-color:yellow;">') into :results
FROM SSA_OCR.TempSearchable

I checked on my dataset and this query works for me:

SELECT *, %iFind.Highlight(Text,'hello', , '<span style="background-color:yellow;">')
FROM Test.Data
WHERE %ID %FIND search_index(TextIndex,'hello')
Eduard Lebedyuk · Feb 6, 2020 go to post

Read method does read 32000 characters by default, you can specify an amount of characters up to $$$MaxStringLength (3 641 144 characters).

If you want to set property to a stream you can do it like this:

do objInArrMain.%Set("Content", fileStreamBase64, "stream")

I'm not sure when it became available, here's a simple check code:

set stream = ##class(%Stream.TmpCharacter).%New()
do stream.Write(123)
d obj.%Set("prop", stream, "stream")

It should output:  {"prop":"123"}

One other note: you're using file streams for temporary outputs (when building fileStreamBase64), replace file stream with temp stream for better performance.

Eduard Lebedyuk · Feb 6, 2020 go to post

You should initialize the Signature object not with %New method, but with Create or Create509 method.

set sig=##class(%XML.Security.Signature).CreateX509(cert)

do sig.SetSignatureMethod($$$SOAPWSrsasha1)
Eduard Lebedyuk · Feb 6, 2020 go to post

Since ##class(%iFind.Utils).Highlight  and %iFind.Highlight  are the same method, you can pass fourth pTags argument to it:

SELECT %iFind.Highlight(Narrative,'"visibility [1-4] mile*" AND "temp* ? degrees"', , "<span>")
Eduard Lebedyuk · Feb 5, 2020 go to post

You can get columns like this:

 $$$LOGINFO("current result print: " _ result.clave)

Instead of

set printed = result.%CurrentResult.%Print()

$$$LOGINFO("current result print: "_printed)

printed value is 1 because %Print outputs data into the current device and returns %Status.

Eduard Lebedyuk · Feb 5, 2020 go to post

These particular bindings are deprecated.

Replacements are listed in the InterSystems IRIS Adoption Guide which is available in WRC (Downloads - Documents).

Eduard Lebedyuk · Feb 5, 2020 go to post

Another suggestion.

You can define a %ZSTOP routine which would automatically clear ^HITLIST global on job end.

You can also use PPG which would be automatically deleted when job ends.

Eduard Lebedyuk · Feb 4, 2020 go to post

Recommended approach - always use macros for al your GLVN needs (see: DeepSee, %Dictionary). This way reporting is easy - just open inc file and you're done.

%Compiler package contains Traveler/Visitor implementation for ObjectScript but it's not officially supported - use at your own risk.

Although the task is unfortunately unsolvable at compile-time due to the abundant meta programming, such as indirection and xecute.

In your proposed solution you can enable checkbox "Use Wildcards" in Find & Replace and search for * which is essentially everything.

Eduard Lebedyuk · Feb 4, 2020 go to post

<PROTECT> error means you can't access database in the /folder/NSOne_SRC/ directory.

Give the user required rights (at the very least R on that DB) and start a new session.