go to post Eduard Lebedyuk · Apr 18, 2017 You can combine triggers and method generators into trigger generators like this: Class User.Class1 Extends %Persistent { Property prop1 As %String; Property prop2 As %String; Trigger NewTrigger [ CodeMode = objectgenerator, Event = INSERT, Time = AFTER ] { #dim class As %Dictionary.CompiledClass = %compiledclass set proplist = "" for i=1:1:class.Properties.Count() { #dim prop As %Dictionary.CompiledProperty = class.Properties.GetAt(i) if prop.Internal || prop.Calculated || prop.ReadOnly || prop.Private || prop.Identity || prop.MultiDimensional continue set proplist = proplist _ $lb(prop.Name) } do %code.WriteLine($$$TAB _ "set ^dbg($i(^dbg)) = $lb({" _$lts(proplist, "},{") _ "})") quit $$$OK } /// do ##class(User.Class1).Test() ClassMethod Test() { do ..%KillExtent() kill ^dbg &sql(INSERT INTO Class1 (prop1, prop2) Values ('Alice', 1)) &sql(INSERT INTO Class1 (prop1, prop2) Values ('Bob' , 2)) zw ^dbg } Test: do ##class(User.Class1).Test() ^dbg=2 ^dbg(1)=$lb("Alice",1) ^dbg(2)=$lb("Bob",2) Here's whats going on during compilation. Build list of all relevant properties and write them into proplist variable. Generate trigger code: set ^dbg($i(^dbg)) = $lb({prop1}, {prop2}) And at runtime only set ^dbg gets hit That said I'd have automatically generated some log class and called method log there, passing all properties. Some docs: TriggersGeneratorsProperties methodsIterating through all properties of an object
go to post Eduard Lebedyuk · Apr 17, 2017 Just redefine the trigger with the same name in a child class: Class FormsDev.NewClass1 Extends %Persistent { Property Name As %String; Trigger Insert [ Event = INSERT ] { Set ^dbg = {Name} } /// do ##class(FormsDev.NewClass1).Test() ClassMethod Test() { Kill ^FormsDev.NewClass1D, ^dbg, ^dbg2 &sql(INSERT INTO FormsDev.NewClass1 (Name) Values ('Alice')) &sql(INSERT INTO FormsDev.NewClass2 (Name) Values ('Bob')) zw ^dbg, ^dbg2 } } and child class: Class FormsDev.NewClass2 Extends FormsDev.NewClass1 { Trigger Insert [ Event = INSERT ] { Set ^dbg2 = {Name} } } Test: >do ##class(FormsDev.NewClass1).Test() ^dbg="Alice" ^dbg2="Bob" Also, if you change trigger name, both would be executed. For example Insert in NewClass1: Trigger Insert [ Event = INSERT ] { Set ^dbg($i(^dbg)) = {Name} } And Insert2 in NewClass2: Trigger Insert2 [ Event = INSERT ] { Set ^dbg2($i(^dbg2)) = {Name} } Would result in: >do ##class(FormsDev.NewClass1).Test() ^dbg=2 ^dbg(1)="Alice" ^dbg(2)="Bob" ^dbg2=1 ^dbg2(1)="Bob"
go to post Eduard Lebedyuk · Apr 12, 2017 Whitelist ip's with access to management postal1. Open <install dir>/CSP/bin/CSP.ini2. Set System_Manager.
go to post Eduard Lebedyuk · Apr 12, 2017 Breaks maybe? AFAIK break points are unaffected by compilation.
go to post Eduard Lebedyuk · Apr 12, 2017 1. Convert excel files into csv (manually or automatically)2. Use csv import in %SQL.Util.Procedures class.
go to post Eduard Lebedyuk · Apr 11, 2017 Use ##SafeExpression instead of ##Expression to generate code once.
go to post Eduard Lebedyuk · Apr 11, 2017 You set tSC variable equal to a string: "/ensemble/data/transfer/AncillaryPDF/TMSAUDIO/Apr-11-1/980512729TMSAUDIO1046784936436537800.pdf" However, this variable was (probably) intended to be used as a %Status. Somewhere there is probably a check: $$$ISERR(tSC) $$$ISOK(tSC) Or status variable is set from tSC.
go to post Eduard Lebedyuk · Apr 11, 2017 Possible reasonsClass doesn't have a %Open method. Check class value, and try to execute in a terminal: zw ##class(<class>).%Open(oid)Passing id instead of oid. Try to use %OpenId method instead.
go to post Eduard Lebedyuk · Apr 11, 2017 1. Do you send Authorization Basic header? What's the status code?2. Include session cookie with the request. It should be done automatically.
go to post Eduard Lebedyuk · Apr 10, 2017 1. Go to: SMP -> Menu -> Web Apps -> Your web app.2. Click on DeepSee checkbox.3. Press Save.
go to post Eduard Lebedyuk · Apr 10, 2017 1. Export cube registry class from source server 2. Import cube registry class into target server 3. Execute in a terminal on a target server: set ^DeepSee.CubeManager("activeRegistry") = "Cube.Registry.Class"
go to post Eduard Lebedyuk · Apr 10, 2017 Unit tests should be on a server. Copy your files to "/usr/cachesys/mgr/unittests/" and point ^UnitTestRoot global to it.
go to post Eduard Lebedyuk · Apr 7, 2017 To check new prompt $system.Process method can be used: do $system.Process.TerminalPrompt(8,2,4) Here's a description of all possible values. For me 4 (Current time) is very useful as it allows for a quick performance tracking.
go to post Eduard Lebedyuk · Apr 6, 2017 You're trying to connect to cache from the same cache process. I think the error arises from that.
go to post Eduard Lebedyuk · Apr 6, 2017 You can output to current device, and read that in Caché. Here's a relevant discussion.