go to post Eduard Lebedyuk · May 16, 2019 If you use InterSystems IRIS 2019.2 you can extend from %JSON.Adaptor class, which is similar to XML adaptor and allows property parameters to customize serialization behaviour. In your case %JSONINCLUDE=NONE %ZEN.Auxiliary.jsonProvider skips % and private properties with some flags. You can use that.
go to post Eduard Lebedyuk · May 15, 2019 yes, the proposed solution would work with any external REST API.
go to post Eduard Lebedyuk · May 15, 2019 No. Each Business Host job is a separate process. They can share data with each other by sending request/response messages to each other.
go to post Eduard Lebedyuk · May 15, 2019 I'd recommend System Default settings to do mass edit of Business Host settings.Context superclass can help but it would break abstraction and probably be rather slow.
go to post Eduard Lebedyuk · May 14, 2019 Check great series of articles on global mapping by @Brendan Bannon.
go to post Eduard Lebedyuk · May 13, 2019 Sorry, I meant Ens.StreamContainer class.Updated snippet code.
go to post Eduard Lebedyuk · May 13, 2019 You need to specify where you want to send your request. Something like this should work. Method OnD03Alert(req As User.Alert, Output resp As Ens.StreamContainer) As %Status { #Dim sc As %Status = $$$OK #Dim test As %Integer = 0 Set httprequest = ##class(%Net.HttpRequest).%New() Set httprequest.Server = "www.usamobility.net" Set httprequest.Location = "cgi-bin/wwwpage.exe" Do httprequest.SetParam("PIN", ..PIN) Do httprequest.SetParam("MSSG", "motogplay") Set sc = httprequest.Post(, test, $$$NO) If $$$ISOK(sc) { Set stream = httprequest.HttpResponse.Data Set resp = ##class(Ens.StreamContainer).%New(stream) } Quit sc } Also Ensemble operations must return persistent objects so I replaced string with Ens.StreamResponse.
go to post Eduard Lebedyuk · May 13, 2019 AFAIK .1 or .2 for that matter is not version, just index of sorts.
go to post Eduard Lebedyuk · May 9, 2019 It somewhat defeats the purpose of $zf(-100).Parametrized commands are generally better.
go to post Eduard Lebedyuk · May 9, 2019 Check $zg(-100) docs. set cmd = "ps" set arg = 4 set arg(1) = "-Af" set arg(2) = "|" set arg(3) = "grep" set arg(4) = "username" set sc = $zf(-100, "/SHELL", cmd, .arg)
go to post Eduard Lebedyuk · May 7, 2019 SQL is rather static and wants to be resolved at compile time.What do you want to achieve?You can have a classmethod that returns resultset(s). Check Sample.Person for example.
go to post Eduard Lebedyuk · May 6, 2019 I'm using Cache-Tort-Git UDL fork and really recommend it. It's a great source control hook!
go to post Eduard Lebedyuk · May 6, 2019 1) Yes.2) Use zwrite command for debugging and key access to get individual values: zwrite tSettings set value = tSettings("MySettingName") Note, that if you want production host settings, you'll need to use GetHostSettings method from the same class.
go to post Eduard Lebedyuk · May 5, 2019 Some thoughts.1. Do not use Hungarian notation.2. Do not use ByRef params/dynamic objects/$lists/args... as an arguments. There are two exceptions: you don't know the number of arguments or there's more than 10 arguments.3. Method should not parse arguments, only validate arguments. If caller passed invalid input it's caller problem. Fail fast.4. Mandatory arguments go first.5. If several methods have similar signatures, the order of arguments should be the same.6. Same logical arguments in different methods should have the same names.7. Arguments should be consistent. If you pass primitives, pass primitives everywhere. If you pass dynamic objects, pass them everywhere.8. Return types should also be consistent.9. If it's object methods and you pass the same optional arguments in several methods extract these arguments as a property.
go to post Eduard Lebedyuk · May 5, 2019 Open JAR file with any archiver program (7zip, WinRar)and check that demo.cashreg.json.JSONValidator class exists.I used this functionality with %Library.GlobalBinaryStream/byte[] and it worked for me. Here's a sample.
go to post Eduard Lebedyuk · Apr 30, 2019 Thank you, @Steven Hobbs ! I'll try to fix my code on LE platforms at the very least.There are some unusual rules that must be followed if you want to get the same results as the $LISTxxx functions get in IRIS/Caché.Is there any place I can familiarize myself with these rules?
go to post Eduard Lebedyuk · Apr 23, 2019 You can do it with a special property class. Here's how it works: Class Testing.PropertyClass { Parameter myPropName; } Class Testing.MyPersistentClass Extends %RegisteredObject [ PropertyClass = Testing.PropertyClass] { Property p1 As %String(MAXLEN = 5, myPropName = "myPropValue"); } But I recommend you to check RESTForms project (part1, part2), which sounds like what you're doing -automatic REST interface for persistent classes. It also defines property class for similar purposes.