Eduard Lebedyuk · Dec 10, 2018 go to post

Try this:

set test = 2

set sc=req.Get("/api?city=baltimore&postall_code=212", test)

it would display response error.

Also please post:

write $System.Status.GetErrorText(sc)
Eduard Lebedyuk · Dec 10, 2018 go to post

Try this.

1. Stop caché.

2. In  cache.cpf write correct remote license server

[LicenseServers]
LOCAL=host,port

where port usually is 4001

3. Start instance

Instance should start and show correct license information.

Eduard Lebedyuk · Dec 10, 2018 go to post

The benefits are:

  • You only need one license key for many servers
  • Server can consume however much licenses it needs, up to a specified max limit.

Use it for multiserver deployments.

Eduard Lebedyuk · Dec 9, 2018 go to post

Submitted code is not public by default.

Players get different inputs for puzzles.

All timings are calculated from the moment the puzzle is published, not the moment you start working on it.

Assuming fastest coder would publish the code, finding it and rewriting it is going to take time.

Moreover fastest solutions usually use, let's say, advanced language-specific concepts, so starting from scratch could often go even faster.

Eduard Lebedyuk · Dec 9, 2018 go to post

Are you talking about %SQL.Util.Procedures:CSVTOCLASS?

I've used it many times and it works with masked delimiters just fine.

Can you post an example?

Eduard Lebedyuk · Dec 3, 2018 go to post

%INLIST assumes a list structure and you're passing a string.

There are two ways so solve it:

1. Store list structure right from beginning. To do that define your property as:

Property mylist as %List(MAXLEN="") [InitialExpression = {$lb("route1", "route2", "route3"}];

and in your method you don't need $listbuild as you already have a list structure in your property, so replace:

set routeList = $LISTBUILD(mylist) 

with

set routeList = yourObj.mylist

2. If you already have a lot of comma-delimited strings, you can convert them to list. In this case property stays the same, but replace:

set routeList = $LISTBUILD(mylist) 

with

set routeList = $ListFromString(mylist)

I recommend first approach.

Also read the docs about $list functions. It is one of the core Cache concepts.

Eduard Lebedyuk · Dec 3, 2018 go to post

*** Do you see any drawback or issues with this? Can there be any other impact due to this?

This is absolutely not a recommended approach.

Here's how you can do it.

  1. Create your own class MyString that extends %String and specifies MAXLEN parameter (I recommend 5000 or 10000, but something specific in any case).
  2. Use %Dictionary package to iterate over all your persistent classes. In there:
    • open each class
    • iterate over its properties
    • change %String type if found to MyString
    • save class
  3. Recompile modified classes.
Eduard Lebedyuk · Dec 2, 2018 go to post

It reads up to 1000000 characters, not stopping on line terminator.

I want x variable to contain only one line from file.

Eduard Lebedyuk · Nov 29, 2018 go to post

Check LIKE documentation:

ESCAPE Clause
ESCAPE permits the use of a wildcard character as a literal character within pattern. ESCAPE char, if provided and if it is a single character, indicates that any character directly following it in pattern is to be understood as a literal character, rather than a wildcard or formatting character. The following example shows the use of ESCAPE to return values that contain the string '_SYS':

SELECT * FROM MyTable
WHERE symbol_field LIKE '%\_SYS%' ESCAPE '\'

So in your case:

SELECT ID, CompanyName
FROM Table1
WHERE CompanyName LIKE '%\%%' ESCAPE '\'
Eduard Lebedyuk · Nov 26, 2018 go to post

Right you are!

I usually store files external from database and write a simple persistent class Document { GUID, DisplayName, FileStream }. User requests files by GUID, and it's served to him with Displayname in header.

Additionally files are never named on filesystem by Displayname,  or any kind of user input but rather by hash or a simple incremental counter.

Storing more than 1k (10k) files per directory is not recommended, if possible add more directories (by date, etc.)

Eduard Lebedyuk · Nov 26, 2018 go to post

If this is your own code block then you could initialise k1 first

As the error source is:

zS2+2^GWH.Messages.Eobs.AKISegmentCheck.Thread1.1

it's probably a generated BPL. I'd check The method S2 of GWH.Messages.Eobs.AKISegmentCheck.Thread1 class. From it you can determine what BPL activity it corresponds (probably something right at the beginning). After that it's easy to fix BPL error.

Eduard Lebedyuk · Nov 23, 2018 go to post

The rewards seem to be almost sold out after an hour.

Can we add some new ones in the future?

How about Raspberry PI board? Arduino board?

Eduard Lebedyuk · Nov 20, 2018 go to post

Also, if I follow your steps and open the eventlog I get the message ERROR #5580: SQL Privilege Violation: 'User Testuser is not privileged for the operation' SOURCE ELEMENT: %ZEN.Component.tablePane (table)

Testuser does not have required privileges to access Ens_Util.Log table. Add SELECT privilege for the Testuser. You may also need to add %DB_<DBNAME> role.

I previously got this error when trying to open the messagebank from the production configuration.

You'll need SELECT privilege on Ens.MessageHeader and %Ens_MessageHeader resource on U.

I have (sort of) accomplished this in Ensemble, but in HealthConnect/Share I just can't get it done.

How?

I should clarify when I say monitor, I mean being actually able to see the production and navigate the message bank. Being able to see the routingrules and/or transformations would be nice, but not necesary.

Check other available pages and resources. There are separate resources for message headers, message contents, visual trace, rules and so on. Production config page is exactly for configuring production.

Eduard Lebedyuk · Nov 20, 2018 go to post

You can use Event Log Viewer to monitor Ensemble production.

Create a role that has these resources:

  • %Ens_EventLog on U
  • %Ens_Portal on U

And give to the user only this role (plus RO access to the DB probably).

As a result user can access only Event Log:

There's a complete list of Ensemble resources with their descriptions in docs, so other pages could be made available to the user.

Eduard Lebedyuk · Nov 20, 2018 go to post

If you have ArchivePath setting specified, then the files would be moved there. Otherwise they are deleted.

Programs that restore deleted files may be able to restore these files.

Eduard Lebedyuk · Nov 20, 2018 go to post

I don't think that behavior can be easily modified. JSON_OBJECT checks first symbol of a value and if it's a { or a [, does the conversion.

You can try %ZEN.Auxiliary.altJSONSQLProvider class to generate JSON from SQL queries.

we don't always know which properties will contain these values

Why? Can a property contain JSON or not JSON? You can also try to parse JSON on a first save and save individual values instead.

Eduard Lebedyuk · Nov 20, 2018 go to post

Do you want to access properties without coding them?

Use $property for that:

set obj = ##class(A).%New()

for i=1:1:3 {

   set $property(obj, "Doctor" _ i) = ##class(%PopulateUtils).Name()

}

zwrite obj
Eduard Lebedyuk · Nov 19, 2018 go to post

What version are you using?

I think you can benefit from REST API architecture, so FilterDate would be a url parameter (esp. if it's the only one).

Eduard Lebedyuk · Nov 18, 2018 go to post

You need to write it. From docs:

You can execute your custom code when certain events occur. Two steps are required:

 1. Define the ^%ZSTART routine, the ^%ZSTOP routine, or both.

  • In these routines, you can define subroutines to execute when the certain activities start or stop.
  • ^%ZSTART and ^%ZSTOP must be defined in the %SYS namespace, although they can be mapped to a non-default database.

2. Use the Management Portal to configure Caché to invoke the desired subroutines.

Specifically, if you define the routine ^%ZSTART and ^%ZSTOP and you include subroutines with specific names, the system automatically calls these subroutines when the activity is beginning or ending. The subroutine names are as follows:

  • SYSTEM — Executed when Caché as a system starts or stops
  • LOGIN — Executed when a user performs a login or logout using the %Service_Console or Service_Telnet services.
  • JOB — Executed when a JOB begins or ends
  • CALLIN: — Executed when an external program begins or completes a CALLIN

For example, when a system starts, the system automatically invokes SYSTEM^%ZSTART, if that is defined and if you have used the Management Portal to enable this subroutine.

SYSTEM^%ZSTART and SYSTEM^%ZSTOP are run with $USERNAME set to $system and $ROLES set to %All. To run your code with a different username, use $SYSTEM.Security.Login() to set the desired name and then continue with your custom code. If you use JOB to launch any additional processes, those processes will inherit the same username (and roles) as the initiating process.

Enabling %ZSTART and %ZSTOP
Once the routines have been designed, developed, compiled, and are ready to be tested, individual entry points may be enabled through the Management Portal. Navigate to the Startup Settings page by selecting System Administration, then Configuration, then Additional Settings, then Startup Settings, and edit the appropriate individual settings:

  • SystemStart, SystemHalt
  • ProcessStart, ProcessHalt
  • JobStart, JobHalt
  • CallinStart, CallinHalt

To deactivate one or more of the entry points, use the same procedure but change the value to false.