go to post Eduard Lebedyuk · Apr 10, 2019 That's because first code generation is run during Test.String compilation, which does not have Test method.Add something like this at the beginning: #; don't generate any code if it not for a property quit:%mode="method" $$$OK
go to post Eduard Lebedyuk · Apr 10, 2019 Thank you!NoContext helped. What does it mean?This works too btw: d %code.WriteLine(" q ..Test()")
go to post Eduard Lebedyuk · Apr 10, 2019 Can you share the code please?Changed .. to z and compilation fails for me.
go to post Eduard Lebedyuk · Apr 9, 2019 Use methods from Ens.DataType.UTC class to convert UTC time to local timezone.
go to post Eduard Lebedyuk · Apr 9, 2019 Okay, how do I make this work with methods?On property get/set I need to call instance method.I've tried this: Class Test.String Extends %String { Method Get() As %String [ CodeMode = objectgenerator ] { do %code.WriteLine($c(9) _ "Quit ..Test()") quit $$$OK } } And class: /// set obj = ##class(Test.Obj).%New() /// w obj.prop Class Test.Obj Extends %RegisteredObject { Property prop As Test.String; Method Test() { quit $random(100) } } But it fails to compile.
go to post Eduard Lebedyuk · Apr 9, 2019 Yeah, apparently only DeepSee and Ens packages/globals can be mapped successfully.Tried random package and it didn't show up even after mapping to %ALL.
go to post Eduard Lebedyuk · Apr 9, 2019 I created these mappings (no restarts):Ens* global mapping for ENSLIB -> USERDeepSee* global mapping for ENSLIB -> %ALLEns* package mapping for ENSLIB -> USERHere's the result:
go to post Eduard Lebedyuk · Apr 9, 2019 Turns out it's much easier than I thought: Class Test.String Extends %String { ClassMethod Get() As %String [ CodeMode = objectgenerator ] { do %code.WriteLine($c(9) _ "Quit $g(^Test.String, 0)") quit $$$OK } ClassMethod Set(%val As %String) As %String [ CodeMode = objectgenerator ] { do %code.WriteLine($c(9) _ "Set ^Test.String = %val") quit $$$OK } } Example: set obj = ##class(Test.Obj).%New() write obj.prop >0 set obj.prop=1 write obj.prop >1
go to post Eduard Lebedyuk · Apr 9, 2019 I downloaded IRIS Community edition (store/intersystems/iris:2019.1.0.510.0-community) and was able to create package and global mappings without any issues.
go to post Eduard Lebedyuk · Apr 9, 2019 Do you want it for debugging or logging purposes?If for debugging, here's a series of articles Debugging Web (part 1, part 2) dealing with REST Debugging.Atelier can be used to debug REST.
go to post Eduard Lebedyuk · Apr 9, 2019 Is it one node or known nodes which can contain characters for escaping?If so custom datatype may be a better solution.
go to post Eduard Lebedyuk · Apr 9, 2019 Can you please provide an example?I'm aware only of %XML.PropertyParameters but there's nothing but parameters.
go to post Eduard Lebedyuk · Apr 9, 2019 Here's what I've coded.Property: Class Test.String Extends %String { ClassMethod StorageToLogical(%val As %String) As %String [ CodeMode = objectgenerator ] { set property = $g(%member) do %code.WriteLine($c(9) _ "Quit """ _ property _ """") quit $$$OK } ClassMethod LogicalToStorage(%val As %String) As %String [ CodeMode = objectgenerator ] { set property = $g(%member) do %code.WriteLine($c(9) _ "Quit """ _ property _ """") quit $$$OK } } Class: Class Test.Obj Extends %RegisteredObject { Property prop As Test.String; } However reference to property does not return anything (expected to return property name): w obj.prop zw obj.prop >"" Any ideas?
go to post Eduard Lebedyuk · Apr 8, 2019 Comment out OnGetConnections method and restart the service.Do you still get errors?
go to post Eduard Lebedyuk · Apr 6, 2019 You can use DATEDIFF: set tx = $ZDT($H,3,1,3) hang 5 write $SYSTEM.SQL.DATEDIFF("hour", $ZDT($H,3,1,3), tx) >0 write $SYSTEM.SQL.DATEDIFF("second", $ZDT($H,3,1,3), tx) >-6
go to post Eduard Lebedyuk · Apr 6, 2019 Good article!Please post docker-compose definition as a text.There's a code formatting style too