go to post Eduard Lebedyuk · Aug 14, 2017 Sure: Set filename = "/tmp/pictures.json" Set array = [].%FromJSON(filename)
go to post Eduard Lebedyuk · Aug 14, 2017 The problem is not with WSDL itself, but rather with the generated classes. There seems to be a loop dependency. Try recompiling.Strategic placement of DependsOn keyword may help.
go to post Eduard Lebedyuk · Aug 13, 2017 Missed it. Rebuild from management portal is equal to ##class(Package.Class).%BuildIndices(), except management portal rebuild is done asynchronously, so you need to go to SMP - Menu - Background Tasks to check that it's done. ##class(Package.Class).%BuildIndices() is done synchronously so you know immediately that indices are rebuilt.
go to post Eduard Lebedyuk · Aug 11, 2017 Copy them into new array with keys = target property value. Iteration over this new array would be ordered as desired. Or when you set your array initially you can set keys = target property value.Another option is to order by local. Set some local with subscript = target property value, and local value as an oref. Then iterate over the local - you'll get ordered orefs.
go to post Eduard Lebedyuk · Aug 10, 2017 Adding an index doesn't built it for existing data. Only data added after the index is created is indexed automatically. You need to rebuild the index: w ##class(Package.Class).%BuildIndices() Documentation on index building.
go to post Eduard Lebedyuk · Aug 10, 2017 1. How do you want to use this partial index? 2. NULL values are indexed, same as any other value (with one difference that any number of NULL values are allowed in a Unique index). Consider the following example: Class Sample.Person Extends %Persistent { Property Name As %String; Index NameIndex On Name; /// do ##class(Sample.Person).Test() ClassMethod Test() { kill ^Sample.PersonD, ^Sample.PersonI do ..AddPerson("ed") do ..AddPerson("ed") do ..AddPerson("bob") do ..AddPerson() do ..AddPerson() zw ^Sample.PersonD, ^Sample.PersonI } ClassMethod AddPerson(Name) { set p = ..%New() set:$d(Name) p.Name = Name do p.%Save() } Whn I run the text method: do ##class(Sample.Person).Test() I get the following data global: ^Sample.PersonD=5 ^Sample.PersonD(1)=$lb("","ed") ^Sample.PersonD(2)=$lb("","ed") ^Sample.PersonD(3)=$lb("","bob") ^Sample.PersonD(4)=$lb("","") ^Sample.PersonD(5)=$lb("","") And the following index global: ^Sample.PersonI("NameIndex"," ",4)="" ^Sample.PersonI("NameIndex"," ",5)="" ^Sample.PersonI("NameIndex"," BOB",3)="" ^Sample.PersonI("NameIndex"," ED",1)="" ^Sample.PersonI("NameIndex"," ED",2)="" As you see NULL values are indexed same as any other value. Index global has the following structure: ^ClassIndexGlobal(IndexName, IndexValue, Id) = DataStoredInIndex Where: ClassIndexGlobal - is a global name used for storing class globals. Defined in Storage.IndexName- is a name of the indexIndexValue - is a collated stored value (so "bob" becomes " BOB", and NULL becomes " "). Some additional info on collation. Documentation.Id - object idDataStoredInIndex - any additional data stored in index. Documenatation. Also for this SQL: SELECT ID FROM Sample.Person WHERE Name IS NULL The following plan that uses our index gets generated: Read index map Sample.Person.NameIndex, using the given %SQLUPPER(Name), and looping on ID.For each row: Output the row.
go to post Eduard Lebedyuk · Aug 10, 2017 If you have a method that only returns dynamic object or array you can use [codemode = expression]: ClassMethod TestGETMixedDynamicObject(class As Frontier.UnitTest.Fixtures.Class) As %DynamicObject(PUBLIC=1) [codemode=expression] { { "class": (class) } }
go to post Eduard Lebedyuk · Aug 9, 2017 Use old json provider: set st = ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(json, class,.obj, $$$YES) Instead of class argument, the json can contain _class property.
go to post Eduard Lebedyuk · Aug 9, 2017 Settings are not really meant to be used like that.If you want to report usage volume the best option would be creting a DeepSee cube over Ens.MessageHeader class. For a limited subset of analytic operations SQL may be enough.
go to post Eduard Lebedyuk · Aug 8, 2017 Here's what I came up with. Business service (works in SYNC or ASYNC mode depending on OneWay setting): Class Passthrough.PassthroughService Extends EnsLib.SOAP.GenericService { Property DefaultResponce As %String(MAXLEN = "") [ InitialExpression = "<soap:Envelope><soap:Body></soap:Body></soap:Envelope>" ]; Parameter SETTINGS = "OneWay:Basic"; /// Pass through to OnProcessInput() Method ProcessBody(pAction As %String, pRequestBody As %CharacterStream, pResponseBody As %CharacterStream) As %Boolean { Set tSC=..ProcessInput(pRequestBody, .pResponseBody, pAction) Set:pResponseBody="" pResponseBody = ..DefaultResponce Quit $$$OK } } And a BP for ASYNC logging (you need to set it as a target for BS only if you want ASYNC mode and logging, otherwise just call BO directly): Class Passthrough.PassthroughProcess Extends Ens.BusinessProcess [ ClassType = persistent ] { /// Configuration item to which to send messages Property TargetConfigName As Ens.DataType.ConfigName; Parameter SETTINGS = "TargetConfigName:Basic:selector?multiSelect=0&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}"; Method OnRequest(pRequest As EnsLib.SOAP.GenericMessage, Output pResponse As EnsLib.SOAP.GenericMessage) As %Status { Quit ..SendRequestSync(..TargetConfigName, pRequest, .pResponse) } } Default EnsLib.SOAP.GenericOperation can be used for BO.
go to post Eduard Lebedyuk · Aug 8, 2017 Have you thought about writing an article on External Service Registry best practices? It seems like a very interesting topic.
go to post Eduard Lebedyuk · Aug 8, 2017 Do you use an issue tracking / collaboration system? If so which one. Any you would recommend or immediately dismiss based on personal experience?I use Github and GitLab. Issues are tracked there. They are fairly similar, use GitLab if you want on-premise solution.How do you keep track of large code bases? Thousdands of folders named backup1, backups2, ..., SVN, git?Git.Do you have a development server to which you commit and test features there, or do you rather run a local copy of caché and implement features locally first, then push to the server?Everything is implemented and tested locally. Then I push to a version control. Continuous integration does the rest.
go to post Eduard Lebedyuk · Aug 8, 2017 I have modified Directory to point to a physical path, and restarted Caché. Still getting 404. UPD. Adding trailing slash to directory name solved my problem.Thank you.
go to post Eduard Lebedyuk · Aug 7, 2017 Here's an example of calling class method with two parameters: <call method="Method"> <parameter expression="%request.Get("URLPAPAM")"/> <parameter value="123"/> </call> Check %ZEN.Report.call and %ZEN.Report.parameter for details.
go to post Eduard Lebedyuk · Aug 6, 2017 User roles should be limited to databases in that namespace.
go to post Eduard Lebedyuk · Aug 5, 2017 Why do you prefer $System.Status.OK()to $$$OK and $System.Status.IsError(sc) to $$$ISERR(sc)and $$$ISOK(sc)?