go to post Sean Connelly · Aug 25, 2017 Boooooom, John with an epic Friday afternoon answer!Thanks John, that deserves a beer...
go to post Sean Connelly · Aug 25, 2017 Kind of agree, just wondering what type of system has transactions failing so frequently that a speedy logger is needed.
go to post Sean Connelly · Aug 25, 2017 Just a simple suggestion. Wrap the log write into a classmethod and then job the method, any writes in the second job won't be affected by the first jobs rollback.
go to post Sean Connelly · Aug 23, 2017 That's a good question, but since none of us commenting here work for InterSystems, we can only assume it was an oversight. Did you try Timothy's suggestion below to use the following as the fullwidth comma escape, he tried it out and it works. , I personally don't use Zen, so can only make suggestions, and this is as far as my suggestions can go on working around this limitation.
go to post Sean Connelly · Aug 22, 2017 LOL, this is why I don't do Zen!Give me a client side framework such as Ext-JS every day of the week...
go to post Sean Connelly · Aug 22, 2017 Unfortunately, , wouldn't work as it's passed through $ZCVT(tHeader,"O","HTML") which would result in... columnHeaders="House number,apartment"
go to post Sean Connelly · Aug 22, 2017 USER>set string="A,B,C,D,House number,aparment,E,F,G,H" USER>for i=1:1:$l(string,",") w !,$piece(string,",",i) ABCDHouse number,aparmentEFGH
go to post Sean Connelly · Aug 22, 2017 More info on fullwidth comma...http://www.fileformat.info/info/unicode/char/ff0c/index.htmWorks fine from the command line...USER>set string="House number,aparment" //contains a full width comma USER>w $piece(string,",") // trying to piece with a normal commaHouse number,aparment
go to post Sean Connelly · Aug 22, 2017 Don't cut and paste the arrows as well, just the comma, the arrows were just to make the comma stand out in the post, so just cut... ,
go to post Sean Connelly · Aug 22, 2017 Try cutting and pasting this fullwidth comma into your code, looks similar... >>> ,<<<
go to post Sean Connelly · Aug 22, 2017 Taking a quick look at the Zen code, I can see that it does an HTML escape on the comma separated values with $ZCVT(tHeader,"O","HTML")The problem with that is...House number, apartmentwill turn into...House number&#44; apartmentwhich defeats the idea of using an escape for the comma, so no, this suggestion won't work for you
go to post Sean Connelly · Aug 21, 2017 Out of context of the original code, I agree.The actual implementation is there to stop an infinite loop on objects that reference each other as part of a JSON serialiser, see line 9...https://github.com/SeanConnelly/Cogs/blob/master/src/Cogs/Lib/Json/Cogs....I'm not sure the construction of seen($THIS) is so much incorrect, just problematic. Both seen($THIS) and seen(""_$THIS) will produce an array item with a stringy representation, and works perfectly fine with exception of the unwanted side effect.My assumption was that $THIS used inside the $get was to be avoided for persistent classes, whilst I could continue to use the OREF for non persistent classes, hence finding that the persistent objects OID was a perfectly good workaround.However, as it turns out seen(""_$THIS) prevents the unwanted behaviour and makes the code much simpler to read, so thanks to Timothy for testing a different idea out.Out of interest, I have since discovered that the pattern of seen(+$THIS) is used extensively in Caché / Ensemble library code, where the + symbol will coerce the string to the ordinal integer value from the OREF. I was tempted to use this approach, but one thing I am not sure of is if ordinal values are unique across a mixed collection of objects...
go to post Sean Connelly · Aug 21, 2017 >I suspect many users may view this as "WRC-lite" and have a sense of entitlement based on their ongoing financial commitment to ISC.I came to the same conclusion.If I was new to DC I could easily think that everyone providing answers is an InterSystems employee and not realise that volunteers are giving up their time and goodwill to help others. Regardless, its still nice to say thank you.Perhaps it should be made more obvious who are volunteers and moderators?
go to post Sean Connelly · Aug 9, 2017 The short (incorrect) answer that you are looking for isset ..Count=..Count+1$$$TRACE(..Count)BUT, if you do this, you will notice that whilst Count does indeed increase with each message, it will not persist back to your settings.Setting properties on an operation are just for convenience, they provide read access to the values held back in the production XDATA / the table Ens_Config.ItemIf you want to dynamically update the setting values then you will need to look at the classes, Ens.Config.Production and Ens.Config.ItemBut, as stated, it's best not to hijack static settings for a dynamic purpose. Updating the settings with every message will cause a production update event each time, and possibly other side effects.If you want to track dynamic values at the operation level then have a look at pre-built services and operations that implement $$$EnsStaticAppData and $$$EnsRuntimeAppData, these macro helpers will save things like counts back to a persistent global.Seems like a lot of hard work when you could just query the count and add a base value to it.
go to post Sean Connelly · Aug 8, 2017 Probably not a good idea to change the production configuration settings with every operation call, each change will trigger a production update request on the production view.If the customer wants to see a counter since a defined point then it sounds like there might be a point in time that can be used. In which case you get a count using SQL...select count(id)from Ens.MessageHeaderwhere TargetConfigName='CosTutorial.testIncrementalParameter' and TimeCreated between '2017-08-07' and '2017-08-08'