go to post Eduard Lebedyuk · Nov 24, 2021 Try it like this: Class User.ResultsMessage Extends (%Persistent, %XML.Adaptor) { Property PersonIDs As list Of %String(XMLITEMNAME = "PersonID", XMLNAME = "PersonIDs", XMLPROJECTION = "WRAPPED"); XData Data { <Results> <PersonIDs> <PersonID>1000000</PersonID> <PersonID>1000001</PersonID> <PersonID>1000005</PersonID> </PersonIDs> </Results> } /// do ##class(User.ResultsMessage).Test() ClassMethod Test() { Set text = ##class(%Dictionary.XDataDefinition).IDKEYOpen($classname(), "Data").Data Set reader = ##class(%XML.Reader).%New() Set sc=reader.OpenStream(text) Do reader.Correlate("Results","User.ResultsMessage") While reader.Next(.msg,.sc) { Write !,"Count(): "_msg.PersonIDs.Count(),! } Write:$$$ISERR(sc) $System.Status.GetErrorText(sc) } } Docs.
go to post Eduard Lebedyuk · Nov 19, 2021 Have you tried connecting to this second DSN right from the start?
go to post Eduard Lebedyuk · Nov 11, 2021 Well, enjoy. UPD: it was missing isc.util.dbf.Field. Class isc.util.DBF.Field Extends %SerialObject [ ClassType = serial, ProcedureBlock ] { Property name As %String(TRUNCATE = 1); Property type As %String(TRUNCATE = 1); Property length As %Integer; Property decimals As %Integer; }
go to post Eduard Lebedyuk · Nov 10, 2021 Check out my series of articles: Debugging Web. Add this code to see call parameters: set %response.ContentType = "html" do ##class(%CSP.Utils).DisplayAllObjects() return $$$OK
go to post Eduard Lebedyuk · Nov 9, 2021 Would disabling the index with SetMapSelectability help? Enable it back again after adding the data and rebuild.
go to post Eduard Lebedyuk · Nov 3, 2021 Install Docker inside WSL2 (not DD on Windows). Alternatively you can just install IRIS in WSL2.
go to post Eduard Lebedyuk · Aug 27, 2021 is there a way for me to execute in SQL for the above? Of course! Queries are TVFs, you can CALL them or SELECT from them: SELECT * FROM %SYSTEM.License_ConnectionAppList() Summary: SELECT * FROM %SYSTEM.License_Counts()
go to post Eduard Lebedyuk · Aug 25, 2021 Do you have SMP access? If so: Open any CSP app config, i.e. /csp/user. Note which folder it takes files from (CSP Files Physical Path property). Export production/classes/whatever into this folder into one xml file. Download the file from a browser.
go to post Eduard Lebedyuk · Aug 13, 2021 What do you want your $list to look like? If you want the end result to be like this: $lb("das", "is", "wp", "dsa", "nmk") try this code (assumes dir is shorter that 3 641 144 chars): ClassMethod test(dir = "test.txt") { set file = ##class(%Stream.FileCharacter).%New() set file.LineTerminator = $c(1) do file.LinkToFile(dir) set str = file.Read($$$MaxStringLength) kill file set separator = $c(13,10) do { set newstr = str set str = $replace(str, separator _ separator, separator) } while newstr'=str set:$e(str, 1, $l(separator))=separator str=$e(str, 1 + $l(separator), *) set:$e(str, *-$l(separator)+1, *)=separator str=$e(str, 1, *-$l(separator)) set list = $lfs(str, separator) quit list } This is a naive implementation assuming you don't care about the speed. Faster solution would go through file line by line.
go to post Eduard Lebedyuk · Aug 4, 2021 There are two parts to it. 1. Create a trigger after INSERT/UPDATE/DELETE. Triggers can work for both sql and object access: Trigger NewTrigger1 [ Event = INSERT/UPDATE/DELETE, Foreach = row/object, Language = objectscript, Time = AFTER ] { set ^dbg={fieldname*N} } 2. In the trigger code send an SMS. You can either use an API (a lot of them available) or talk to a GSM modem.
go to post Eduard Lebedyuk · Aug 4, 2021 First you need to create corresponding classed. You can do that by either importing the XSD or manually. Here's a manual approach: Class test.mensajeWS Extends (%RegisteredObject, %XML.Adaptor) { Parameter NAMESPACE = "https://wslexnet.webservices.lexnet/3.22"; Property respuestaEnvioMensaje As respuestaEnvioMensaje; } Class test.respuestaEnvioMensaje Extends (%RegisteredObject, %XML.Adaptor) { Property idEnvio As %Integer; Property tamBloque As %Integer; Property bytesMIME As %VarString; } After that in your BS convert incoming XML string like this: set reader = ##class(%XML.Reader).%New() set sc = reader.OpenString(pRequest.EnviarIniciadoresGeneralOut) quit:$$$ISERR(sc) sc do reader.Correlate("mensajeWS","test.mensajeWS") do reader.Next(.mensajeWSObj,.sc) quit:$$$ISERR(sc) sc // Process mensajeWSObj
go to post Eduard Lebedyuk · Jul 28, 2021 For the case where only a new OnResponse method is added the workaround is executing these update queries: UPDATE process.Context__ResponseHandlers SET "_ResponseHandlers" = 'OnResponseXYZ' WHERE "_ResponseHandlers" = 'OnResponseABC' Where ABC is an old method name, XYZ is a new method name. In a case of several new methods they should be executed from the largest number first.
go to post Eduard Lebedyuk · Jul 27, 2021 Unable to reproduce. Here's my test routine: ByRef kill a set a = 1 set a(1) = 2 do Test(.a) zw a Test(a) set a(1) = a(1) + 1 set a(2) = -1 And here's an invocation result: >d ^ByRef a=1 a(1)=3 a(2)=-1 as you can see a new subscript has been added successfully.
go to post Eduard Lebedyuk · Jul 23, 2021 Datatype classes are used to define object properties, they allow to: Validate values both generic (for example any defined %Integer property by default checks that it's value is an integer) and based on datatype parameters (for example you can have an %Integer(MINVAL=0, MAXVAL=9) property which in addition to checking that it's value is an integer would check that integer value is between 0 and 9) Provide different representations based on context, specifically: Logical (what's stored in globals) Display (what's shown in object) XSD (for XML export/import) ODBC (returned in SQL) Provide generators for utility methods. Article on some examples. Docs.
go to post Eduard Lebedyuk · Jul 22, 2021 Here's an example: Class User.Assert Extends Ens.BusinessProcess [ ClassType = persistent, Language = objectscript ] { Method OnRequest(pRequest As Ens.Request, Output pResponse As Ens.Response) As %Status { Set pResponse = ##class(Ens.Response).%New() $$$LOGINFO("$$$ASSERT(1)") $$$ASSERT(1) // skipped $$$LOGINFO("$$$LOGASSERT(1)") $$$LOGASSERT(1) $$$LOGINFO("$$$ASSERT(0)") $$$ASSERT(0) $$$LOGINFO("$$$LOGASSERT(0)") $$$LOGASSERT(0) Quit $$$OK } }
go to post Eduard Lebedyuk · Jul 22, 2021 This looks more like a WRC issue, but I'd wager a guess that the first and second query use different indices. To be more specific the second query does not use some index due to the need to traverse all RPE.Veterinario rows due to the vet.numConselho > 0 condition. To solve this issue try to rebuild all indices for these 3 tables.