Eduard Lebedyuk · Dec 29, 2017 go to post

You can add Ens.ProductionMonitorService service to your production, which provides a monitor service for the production status

The default behavior of this service is to call UpdateProduction once it notices the production is not up-to-date. Users can override the OnProcessInput method to customize the behavior. It would be enough to automatically restart relevant items and keep production up to date.  

Generally to access/manipulate info about Ensemble and it's hosts use Ens.Director class, i.e. UpdateProduction method.

Eduard Lebedyuk · Dec 28, 2017 go to post

Pool size 4 would be better.

Adding 4 same processes would only make production configuration more complicated.

Eduard Lebedyuk · Dec 28, 2017 go to post

Also possible to use $$$NULL macro:

do $$$AssertEquals(myObj, $$$NULL, "myObj is null")
Eduard Lebedyuk · Dec 28, 2017 go to post

For example, Java Gateway Wizard is at:

http:://host/csp/reg/%25ZEN.Template.ObjectGatewayWizard.JavaHome.cls

I usually use "find in files" and search for page title to find where it is.

[@Jeffrey Drumm]'s answer is way better.

Eduard Lebedyuk · Dec 27, 2017 go to post

in my sample, it should be like P.id = P1.id and P1.id =  P2.id.

It would work like that too.

Also, you self join on the identical fields "ID", so I guess the engine could infer p1.id = p2.id by "P.id  = P1.id and P.id = P2.id" , this would interfere my intention.

Please consider posting:

  • sample classes
  • sample data
  • description of data you want to get
  • what data you want to get
  • query
Eduard Lebedyuk · Dec 27, 2017 go to post

Yes.

SELECT
p.id, p1.id, p2.id
FROM Sample.Person p
LEFT JOIN Sample.Person p1 ON p1.id=p.id
INNER JOIN Sample.Person p2 ON p2.id=p.id
Eduard Lebedyuk · Dec 26, 2017 go to post

If you can, always invoke code directly:

do ##class(circle).radius()

Use classmethod only if you can't invoke method directly.

Eduard Lebedyuk · Dec 26, 2017 go to post

Class include is not required (and does not seem to affect anything) and can be omitted

Include Child

Why that happens, as  methods generators are compiled before methods?

As for the second approach, I'd like to avoid duplicating code (in a real case I have about 20 methods 1-50 lines long).

Eduard Lebedyuk · Dec 26, 2017 go to post

Interesting,

Sorry, that I didn't specify it earlier, but I can't modify Parent.inc too.

Eduard Lebedyuk · Dec 22, 2017 go to post

Have you tried d format flag

d - output Caché numeric properties that have value "" as null
Eduard Lebedyuk · Dec 22, 2017 go to post

Thank you, turns out Telnet was disabled.

I can have only one telnet terminal per windows server or is there an option to specify port?

Eduard Lebedyuk · Dec 21, 2017 go to post

Got "Connection refused". Shouldn't I specify 1972 port? Tried both 'telnet' and 1972 ports, still 'connection refused'.

Eduard Lebedyuk · Dec 21, 2017 go to post

Replacing "" with null seems like a better solution to me as " symbol is escaped to \", so "" should not be encountered in JSON, except for empty strings.

Eduard Lebedyuk · Dec 21, 2017 go to post

It seems to fail on second line of this code sample:

set prevspace="^"_$zu(96,12)
u 0::"^%X364"    ; Set mnemonic space
u 0::prevspace
Eduard Lebedyuk · Dec 21, 2017 go to post

Additional JSON functionality, such as JSON (de)serialization for arbitrary classes was at one point available but currently under review. It may appear in one of future versions. I've posted a workaround.

You can also check RESTForms - REST API  for your persistent classes, it does support JSON (de)serialization. Another article about RESTForms.

Eduard Lebedyuk · Dec 21, 2017 go to post

You can convert object to dynamic object and output it to JSON:

zn "samples"
set per = ##class(Sample.Person).%OpenId(1)
set obj = ##class(%ZEN.Auxiliary.altJSONProvider).%ObjectToAET(per)
write obj.%ToJSON()

Also check %ObjectToJSON in %ZEN.Auxiliary.altJSONProvider class.

Eduard Lebedyuk · Dec 20, 2017 go to post

1. There's no need to instantiate tResponse, it would be reinstantiated later anyway.

2. Please post ConsultaPaciente method from your class specified in WebServiceClientClass setting.

Eduard Lebedyuk · Dec 20, 2017 go to post

2016.2 supports Atelier, so you need to either install new 2016.2 instance or update to 2016.2.

Install atelier by following these instructions.

UPD. Sandbox means you only need sample data? You can install new 2016.2 instance. It takes 10 minutes tops.

Eduard Lebedyuk · Dec 20, 2017 go to post

Another example - lets say you want to delete several files and check that all is fine:

ClassMethod MassDelete(){  #dim sc As %Status = $$$OK  // Deletes the file. Returns true if it succeeds and false otherwise.  // Pass return by reference to obtain the low level return value in case of errors  #define del(%file,%return) ##class(%File).Delete(%file,%return)  set file1 = "file1.txt"  set file2 = "file2.txt"  if (('$$$del(file1, .return1)) | ('$$$del(file2, .return2))) {    set sc = $$$ERROR($$$GeneralError, "Files '%1', '%2' deletion failed with codes: %3, %4", file1, file2, $get(return1), $get(return2))  }  quit sc}

In case of "||" if the first delete was successful , the second delete would not be called. Use '|' to attempt both deletes