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)?
go to post Eduard Lebedyuk · Aug 3, 2017 You can add your own DeepSee dimension levels by extending %DeepSee.Time.AbstractLevel class. Check %DeepSee.Time.Year class for an example of Year level within a time dimension.List of available time level classes is obtained in %DeepSee.Utils:%GetTimeLevelClasses and is used during cube generation.
go to post Eduard Lebedyuk · Aug 3, 2017 You can define a parameter as an ObjectScript expression that it is evaluated at runtime. To do so, specify its type as COSEXPRESSION and specify an ObjectScript expression as the value: Parameter PARAMNAME As COSEXPRESSION = "ObjectScriptExpression"; where PARAMNAME is the parameter being defined and ObjectScriptExpression is the ObjectScript content that is evaluated at runtime.An example class parameter definition would be: Parameter DateParam As COSEXPRESSION = "$H"; Documentation. That said, I'd recommend gradual refactoring of these parameters into methods.
go to post Eduard Lebedyuk · Aug 2, 2017 Ensemble event log? It is stored in Ens.Util.Log class, so you can easily export it to csv/html/xml/pdf/txt from SQL. Here's a sample export to CSV: set rs = ##class(%SQL.Statement).%ExecDirect(,"SELECT * FROM Ens_Util.Log") set file = "C:\InterSystems\Ensemble\mgr\Temp\Ens.Log" do rs.%DisplayFormatted(100, file) // 100 for CSV format Docs for %DisplayFormatted.
go to post Eduard Lebedyuk · Aug 1, 2017 There are several ways to do that.Add from/to arguments to your existing REST servise, so your client asks for a data within a specified time slice.Specifying no arguments yields all dataSpecifying only from yields data starting at from and till nowSpecifying both from and to yields only data acquired between from and toUse websockets.
go to post Eduard Lebedyuk · Jul 31, 2017 If it's a part of Ensemble Production, you need to create Business Operation. Here's a sample BO that does POST request: /// This operation does a POST request to a REST API and receives Auth token Class Production.Operation.NLPAuthOperation Extends Ens.BusinessOperation { Parameter ADAPTER = "EnsLib.HTTP.OutboundAdapter"; Property Adapter As EnsLib.HTTP.OutboundAdapter; Parameter INVOCATION = "Queue"; /// Get Auth token Method GetAuth(request As Ens.Request, Output response As Ens.StringResponse) As %Status { #dim sc As %Statis = $$$OK // Form request body (using Credentials) set input = {"user": ( ..Adapter.%CredentialsObj.Username), "pass": (..Adapter.%CredentialsObj.Password)} // Send post request set sc = ..Adapter.Post(.httpResponse,,input.%ToJSON()) quit:$$$ISERR(sc) sc // Get token from response set token = {}.%FromJSON(httpResponse.Data).token // set response = ##class(Ens.StringResponse).%New(token) quit sc } XData MessageMap { <MapItems> <MapItem MessageType="Ens.Request"> <Method>GetAuth</Method> </MapItem> </MapItems> } } If you're outside of Ensemble, you need to use %Net.HttpRequest class. Here's an example.
go to post Eduard Lebedyuk · Jul 27, 2017 Let's say you have called this url: http://localhost:57772/rest/users/1?fields=list And you have this route: <Route Url="/users/:id" Method="GET" Call="Test"/> Then in your Test method call: write %request.Get("fields") it would output list.
go to post Eduard Lebedyuk · Jul 26, 2017 Turns out, I forgot to setup DispatchClass for /passthrough application. After setting it to EnsLib.SOAP.GenericService, the following URL works: http://localhost:57773/passthrough/PassthroughService/CurrencyConvertor.asmx
go to post Eduard Lebedyuk · Jul 25, 2017 That's $$$defClassDefined(class). It shows that class definition exists (or doesn't), but it doesn't show if a class is compiled.
go to post Eduard Lebedyuk · Jul 24, 2017 %ExistsId does not open an object for %Dictionary package. Just checks the globals (see %Dictionary.CompiledClass for example). The fastest way to check if a class exists would be: write $$$comClassDefined(class)
go to post Eduard Lebedyuk · Jul 24, 2017 For your specific usecase REST seems like a way to go. Check Caché FileServer and ClassExplorer projects - they both do file serving.
go to post Eduard Lebedyuk · Jul 19, 2017 The name is not important. This method is an method generator, so it runs during compilation. But as it produces no code, the method does not get generated.