go to post Eduard Lebedyuk · Jan 29, 2018 You can give user %EnsRole_Operator role:Role for operation staff managing the day-to-day status of a particular production. Users assigned to this role have the Read permission on the current configuration to determine what settings and code are in effect, but do not have permissions to modify the configuration. Operations staff may start and stop interfaces, and may start and stop the production. They do not have access to the contents of messages, but may resend messages which cause issues. Operators may view queue and job information, and may inspect the settings for purges, alerts, credentials, and lookup tables.Other approach would be readonly access the tables of the Ens.Config package.
go to post Eduard Lebedyuk · Jan 29, 2018 enable/diasable ( readonly ) the controllers such as ipaddress and portCan you elaborate on that? What do you want to do?
go to post Eduard Lebedyuk · Jan 29, 2018 Have you checked Locks? If more than one process works with the same global locks are the way to go.
go to post Eduard Lebedyuk · Jan 29, 2018 Consider renaming bookid into Book to have consistent properties names.
go to post Eduard Lebedyuk · Jan 27, 2018 I have an Atelier question.How's that Atelier-related though?
go to post Eduard Lebedyuk · Jan 27, 2018 slash macro: #if $$$isWINDOWS /// #define slash "\" #else /// #define slash "/" #endIf That said, consider using %File API to work with file names. I usually extract "storage directory" as an application-wide setting (normalized and validated on change) and just add a file name. This way user code can ignore most OS path differences.
go to post Eduard Lebedyuk · Jan 25, 2018 There are some utilities for work with images. For example QR code generation via %SYS.QRCode. There is also this Captcha generation project.That said, imagemagick is doubtlessly the best solution.
go to post Eduard Lebedyuk · Jan 25, 2018 SQL way (query docs, 1 means BS): SELECT * FROM Ens_Config.Production_EnumerateConfigItems('Your.Production', 1) Object way: set rs = ##class(Ens.Config.Production).EnumerateConfigItemsFunc("Your.Production", 1) do rs.%Display() Constants for Business Host Type (defined in EnsConstants.inc): #define eHostTypeUnknown 0 #define eHostTypeService 1 #define eHostTypeProcess 2 #define eHostTypeOperation 3 #define eHostTypeActor 4
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()