Announcement Eduard Lebedyuk · Apr 4, 2019 Suppress loss-of-connectivity pop-ups in Management Portal You may have missed it, but it's here.Now popups from SMP when you're restarting the instance or just lost connection can be suppressed.All you need to do is set this global: set ^%SYS("Portal","DisableConnectivityPopup") = 1 Available for 2018.1.2 and later. Documentation. Thank you, @Alexander Koblov for the find! #UI Development #ZEN #Caché 2 3 1 228
Question Eduard Lebedyuk · Apr 2, 2019 OPC Unified Architecture Has anyone worked with OPC Unified Architecture protocol (iot/machine to machine communication protocol for industrial automation)?If so, how did you communicate with it? #IoT #Caché 0 6 0 466
Question Eduard Lebedyuk · Mar 2, 2019 Get concrete class from id I have one abstract class and several subclasses. All share one data/id global.How can I get concrete class name from id (without opening the object)?What I have so far: write $p($lg(^DATAGLOBAL(<id>),1),"~",*-1) It does the job, but is there a more official way? #Beginner #Caché 0 3 0 259
Question Eduard Lebedyuk · Feb 28, 2019 How to ignore terminators on read from TCP device I'm connecting to a remote device using TCP. It has a binary protocol. set host = "" set port = "" set io = $io set device = "|TCP|7000" set timeout = 2 open device:(host:port:"M") use device:(/IOT="RAW") read string:timeout use io zzdump string The problem is when reading from it, I get a 0A (also known as 10 or \n or linefeed) byte, which terminates the read. Expected output: 0000: 42 00 7B 0A 11 But I get this output: 0000: 42 00 7B How can I fix that? #Interoperability #Caché 0 1 0 246
Question Eduard Lebedyuk · Feb 28, 2019 Indirection example does not work Here's a simple indirection snippet. It fails with <UNDEFINED> error and I'm not sure why. ClassMethod ind() { kill info set active = 1 set reactive = 2 for i="active","reactive" { set info(i)= @i } zw info break } I'm getting this exception: <UNDEFINED>zind+5^test.Client.1 *active #Beginner #Caché 0 6 0 482
Question Eduard Lebedyuk · Feb 21, 2019 How do I convert timestamp to utc? I have a date in this format: "YYYY-MM-DD HH:MM:SS+HHMM" how can I convert it to UTC? write $zdth("2018-02-01 00:00:00+0600",3,5) >64680,0 write $zdt("64680,0",3,5) >2018-02-01T00:00:00+03:00 As you see, timezone is lost. Docs for $zdth in timeopt (5) state: Specify time in the form "hh:mm:ss+/-hh:mm" (24-hour clock). The time is specified as local time. The following optional suffix may be supplied, but is ignored: a plus (+) or minus (–) suffix followed by the offset of local time from Coordinated Universal Time (UTC) #Beginner #Caché 0 2 0 1.9K
Question Eduard Lebedyuk · Feb 21, 2019 SetIdentityInsert system-wide? SetIdentityInsert call controls the ability of the user to specify a value for the IDENTITY property when saving a new object, a value for the IDENTITY column or an explicit ROWID value in an SQL INSERT. If IDENTITY_INSERT is false and the user specifies an explicit IDENTITY or ROWID value when saving a new object or inserting a new ROW then an error condition is reported.Setting takes effect immediately and lasts for the duration of the process or until SetIdentityInsert is called again.My question is how can I change this setting system-wide? #SQL #Caché 0 2 0 286
Question Eduard Lebedyuk · Feb 18, 2019 "Pause" BPL business process on error I have a business process.if it has an error it dies, or if a have a catch all/fault handler the execution flow goes there.However, I want another behavior.If any error occurs I want the process to "Pause" (and alert me), so I can figure out what went wrong and resume from the last request.Here's an example of how it could work:If an error is caught, call BOBO defers responseBO sends alertFix BPManually resolve deferred responseI'm not set on the exact pause/resume mechanic but I hope it makes the general idea of what I want clear enough. Ideas? #Business Process (BPL) #System Administration #Ensemble 0 4 0 278
Question Eduard Lebedyuk · Feb 6, 2019 Populating test/initial data How do you populate and update test/initial data for you classes?CSV tables? Globals export? And how do you update test data?Here's one way I found useful for small projects. #Continuous Delivery #Deployment #System Administration #Caché 1 3 0 472
Question Eduard Lebedyuk · Feb 4, 2019 Consume data from websocket I want to consume external websocket api, URL looks like this: wss://site.com/ws/v2/?&token=<token> Checked with external tool (Simple WebSocket Client) that websocket works and I can consume the data.In Cache the relevant functionality is offered by %IO.Socket class. set sock = ##class(%IO.Socket).%New() set sock.SSLConfig = "MyEmptySSLConfig" set sock.TranslationTable="UTF8" do sock.Open("site.com/ws/v2/?&token=<token>","443", 10,.sc) However I get this error: #Frontend #SOAP #Caché 0 17 0 1.3K
Article Eduard Lebedyuk · Jan 28, 2019 2m read Iterate over dynamic object Here's a sample code to display JSON or dynamic object. It shows how to iterate over object, get property values and their paths. #Best Practices #JSON #Caché 9 5 9 4.3K
Question Eduard Lebedyuk · Jan 26, 2019 NULL placeholder in $List functions? Today in docs I found this example using NULL: WRITE $LISTVALID($LB(NULL)),! simplified zzdump $LB(NULL) and NULL can be case-insensitive: zzdump $LB(null) seems the same as just: zzdump $LB() But if null variable is defined then list would contain value from variable. Case sensitive in that situation. Does anyone have any Idea what is this? Is NULL used anywhere besides as a list element? #Beginner #ObjectScript #Caché #InterSystems IRIS 0 5 0 330
Question Eduard Lebedyuk · Jan 24, 2019 Should a property be quoted in object context or not Let's say I have a property as a variable value: set propName="Country" Is there a method to determine, should I quote it to access the object, so would the correct code be: write obj."Country" or just simple write obj.Country is enough? #Beginner #Data Model #Caché #InterSystems IRIS 0 4 0 297
Article Eduard Lebedyuk · Jan 23, 2019 3m read Iterate over Business process activities Recently I needed a classmethod that returns annotation value based on a name of a activity.As doing it at runtime seemed inefficient, I wrote compile-time utility that iterates over all business process activities and generates relevant code.This code could be used in a variety of situations when you need to iterate over business process activities, just add it as a secondary superclass to your BPL processes. #Beginner #Code Snippet #ObjectScript #Ensemble #InterSystems IRIS 1 2 1 383
Question Eduard Lebedyuk · Jan 17, 2019 String or Stream in the same persistent property? I have a persistent class.I want to store one of the properties there as a stream or a string depending on a size.99% of values would be strings (less than $$$MaxStringLength characters) so I don't want to store everything as streams.What do you think of this approach?What's the best architecture to implement in this situation? #Beginner #SQL #Caché 0 4 0 540
Question Eduard Lebedyuk · Jan 9, 2019 Work with devices connected via RS422/RS485 I connected from InterSystems Cache to devices connected via RS232 (commonly known as COM-port).Can the same be done with devices connected via RS422/RS485 interfaces? #Interoperability #Caché 0 2 0 210
Article Eduard Lebedyuk · Dec 29, 2018 6m read Importing code from external libraries Intro Recently I reread this article by @Bernd Mueller. It's about calling DELFATE function from zlib library. In this article I'll demonstrate several different approaches to callout libraries, we'll build the same functionality (compress function) in several different languages and compare them. #Beginner #Callout #Java #Node.js #JavaScript #Caché 1 0 0 648
Question Eduard Lebedyuk · Dec 27, 2018 Pattern matching with '*' and '?' I have an in-memory list of items and I want to check which items match my pattern string.Pattern string is a comma-separated list of items and special symbols like '*' and maybe '?'.There's something similar in $system.OBJ.Compile, it accepts patterns: "*.data.*,Sample.*" - and it would compile 'Sample' package and all 'data' packages.For example: set list=$lb("abc", "c", "aaa", "bbb") set result = ..match(list, "a*,*b") zw result result=$lb("abc","aaa","bbb") #Beginner #Caché 0 7 0 692
Question Eduard Lebedyuk · Dec 16, 2018 Debugging callout library <DYNAMIC LIBRARY LOAD> I have a simple callout library: #define ZF_DLL #include #include #undef ERROR int GetRandom(double* random) { // Py_Initialize(); // Py_Finalize(); *random = 1.0; return ZF_SUCCESS; } int main(int argc, char **argv) { printf("Random: "); double random=0; GetRandom(&random); printf("%lf", random); return 0; } ZFBEGIN ZFENTRY("GetRandom","D",GetRandom) ZFEND I compile this code as a shared library and it works fine with: #Caché #Callout 0 4 0 473
Question Eduard Lebedyuk · Dec 5, 2018 How do I specify System Default Setting for Production setting Added new System Default Setting for Production (not Host) setting.However, Production setting is still the same. I have tried restarting Production and instance, to no avail.How do I specify System Default Setting correctly?Production: #Beginner #Ensemble #Interoperability 0 3 0 492