go to post Eduard Lebedyuk · Jan 25, 2018 You can use Ens.Response class for an empty response and you need to init it: Method OnMessage(request As Ens.StreamContainer, Output response As Ens.Response) As %Status { set response = ##class(Ens.Response).%New() quit $$$OK } If you only want to see streams why not use <trace> in BP?
go to post Eduard Lebedyuk · Jan 24, 2018 Postconditionals are to be used only for the most simple checks, for example: set:a="" a=10 instead of if a="" { set a=10 } But several conditions (or several lines inside) should be as if, I agree.
go to post Eduard Lebedyuk · Jan 24, 2018 For one-line if I prefer postconditionals: set:a b=a As for For - the option with braces. It's more readable. And one line inside For loop quickly and often becomes several lines, so braces become mandatory anyway.
go to post Eduard Lebedyuk · Jan 24, 2018 Why do you need to check it at runtime? If source and target are from different but related classes you can copy by their common ancestor (or by specified ancestor class). Or do you copy properties between two unrelated classes?
go to post Eduard Lebedyuk · Jan 24, 2018 Nice example of using method generators. Why do you need ExistsProperty? Here's a check I usually employ for class properties in generators: if prop.Internal || prop.Calculated || prop.ReadOnly || prop.Private || prop.Identity || prop.MultiDimensional CONTINUE It filters out all systems properties like Concurrency, %%OID and so on.
go to post Eduard Lebedyuk · Jan 23, 2018 When talking about speed, one of the most important questions is what exactly do you need to speed up? You need to determine:what queries are the most popularwhat queries take the most timeto fix it. Some ways to fix performance are (easy to hard):Add indicesChange classesChange application architectureBecause in your case I see at least two request types which require different actions to speed them up:Get last X changesGet last X modified subjects
go to post Eduard Lebedyuk · Jan 22, 2018 Header itself is another layer because it's meta information for the BPL state machine, which you're inside of. So I don't see how you can get header Id from inside the state machine without violating abstractions in place.Still, %Context, %Process and %LastError are documented and acceptable to use.
go to post Eduard Lebedyuk · Jan 22, 2018 You can access %Ensemble("%Process") as ..%Process so: ..%Process.%PrimaryRequestHeader.%Id()
go to post Eduard Lebedyuk · Jan 19, 2018 Why would you want to do that? Here's sample production class: Class Test.Production Extends Ens.Production { XData ProductionDefinition { <Production Name="Test.Production" TestingEnabled="true" LogGeneralTraceEvents="true"> <Description></Description> <ActorPoolSize>1</ActorPoolSize> ion> } } Ens.Config.Production serialized is XData ProductionDefinition and not the class itself. To create production class automatically you need to: Create %Dictionary.ClassDefinition object for your test productionCreate Ens.Config.Production objectCreate %Dictionary.XDataDefinitionSerialize (2) into (3)Insert XData (3) into (1)Save and compile (1)
go to post Eduard Lebedyuk · Jan 19, 2018 Check out Caché FileServer project for a sample of file upload/download.
go to post Eduard Lebedyuk · Jan 19, 2018 Use any of the existing Git hooks for Studio or Atelier. They would work with GitHub and GitLab both.
go to post Eduard Lebedyuk · Jan 18, 2018 Check EvaluateRules method of Ens.Rule.Definition class. It evaluates rule by name and context. You can call it from Studio or Terminal.
go to post Eduard Lebedyuk · Jan 17, 2018 Got it. Usually after enabling HTTPS I add server-wide redirect from HTTP to HTTPS. So in cube I specify port 80 and it automatically redirects to HTTPS.
go to post Eduard Lebedyuk · Jan 17, 2018 If Caché does not work through IIS, you need to configure it. On Windows you can configure Caché to work with IIS, Apache or Nginx.After you have configured the web server to work with Caché, add https support. For example use Let's encrypt as a CA.
go to post Eduard Lebedyuk · Jan 17, 2018 You can use DATEPART function: w $SYSTEM.SQL.DATEPART("year", $h) >2018 w $SYSTEM.SQL.DATEPART("month", $h) >1 The advantage of this approach is more readable code.
go to post Eduard Lebedyuk · Jan 17, 2018 Learning.intersystems.com has a lot of courses you can access for free. They start right from the basics.
go to post Eduard Lebedyuk · Jan 17, 2018 while i was using your code, i am getting this error in response, which says "read" method is unknownYou're getting this error because list of objects does not have this method. Check your list of objects for contents. Seems like json is already converted so you don't need to do that.