go to post Eduard Lebedyuk · Sep 22, 2017 Assuming you're on 2016.2+: set payload = "{""profile_id"":""9XOzzcI8NfSUjxAhEt0cTLRejwmp6HPi"",""biometrics"":[{""timestamp"":""2017-05-17T13:45:40"",""utc_offset"":""+02:00"",""resting_heartrate"":120.0,""spo2"":98.0,""activity_id"":""591c540aac8f295479ee14ce""}]}" set obj = {}.%FromJSON(payload) write obj."profile_id" >9XOzzcI8NfSUjxAhEt0cTLRejwmp6HPi write obj.biometrics.%Get(0).timestamp >2017-05-17T13:45:40
go to post Eduard Lebedyuk · Sep 22, 2017 When would Experience Labs be available on learning.intersystems.com?
go to post Eduard Lebedyuk · Sep 21, 2017 It's really not.You can have "On Demand" task and call it from %ZSTART. This way you can have task scheduler reporting and execute task only when it's required.
go to post Eduard Lebedyuk · Sep 20, 2017 Is there any reason to use Task Manager instead of %ZSTART? Anyway you can have a task that runs hourly, and checks for existence of ^CacheTemp.MyTask global. If the global does not exist, set it and execute the task. If the global exists - quit. Since restart wipes CacheTemp, the global wouldn't exist on startup.
go to post Eduard Lebedyuk · Sep 20, 2017 What if I have extra properties such as InsertTime in the Test.cvs class?What about them? When you call %SQL.Util.Procedures:CSVTOCLASS you need to specify rowtype, corresponding to your CSV structure. If you have InsertTime property you need to reflect it and any other properties CSV has in your rowtype.
go to post Eduard Lebedyuk · Sep 20, 2017 In Ensemble Visual Trace you can filter by Business Host. To do that:Open Ensemble Visual TraceClick on the Business Host you needIn Apply Filter dropdown choose the filter you need (Host or Corresponding)Visual trace would be filtered to messages sent to/from specified Business Host
go to post Eduard Lebedyuk · Sep 20, 2017 Here's how:SMP > Ensemble > Production Configuration > Your Business Service > Settings > Additional Settings > Schedule > Press on the the looking glassIn Schedule Spec Editor press "New"Specify Schedule name and press OKSet "Raw String" schedule or use "Add action" specify a schedulePress "Save spec"Schedule setting in your Business Service should be set nowRestart your Business Service
go to post Eduard Lebedyuk · Sep 20, 2017 To run Business Service once an hour:Specify Ens.InboundAdapter as an adapter for your Business ServiceOn Production Configuration page, in Business Service configuration set Call Interval to 3600.Restart Business Service. It would now be run once an hour (every 36000 seconds)
go to post Eduard Lebedyuk · Sep 20, 2017 To convert string of any format into $horolog, use TO_DATE function: w $SYSTEM.SQL.TODATE("20160105125915","YYYYMMDD") >63922 To convert string of any format to timestamp use TO_TIMESTAMP function: w $SYSTEM.SQL.TOTIMESTAMP("20160105125915","YYYYMMDDHHMISS") >2016-01-05 12:59:15 These functions are available in Caché ObjectScript and SQL.
go to post Eduard Lebedyuk · Sep 20, 2017 Provided you have this csv: car,2000,100.51,27.10.2016, phone,2003,65.8,15.01.2017, You can import it into class Test.CSV: 1. Generate a persistent class Test.CSV set rowtype = "name VARCHAR(50),year INTEGER,amount NUMERIC(9,2),date DATE" set filename = "D:\data.csv" do ##class(%SQL.Util.Procedures).CSVTOCLASS(2, .rowtype, filename,,,,"Test.CSV") 2. Import file or files do ##class(Test.CSV).Import(2,filename) Usually you can't import your CSV right away - the dates are in a different format, etc. You need to modify Import method and property definitions. For example I often: Add FORMAT=4 property parameter for dates to import dates in dd/mm/yyyy format.Find&replace Library. Add this else line in Import method: if $$$ISOK(tStatus) { set tCounter = tCounter + 1 } else { w $System.Status.GetErrorText(tStatus) return} If you have a tab separated file, you need to change Import method signature from: pDelimiter As %String = "," to: pDelimiter As %String = {$c(9)}
go to post Eduard Lebedyuk · Sep 19, 2017 Check out Demo.ZenService.Zen.WeatherReportForm class in ENSDEMO namespace. GetWeatherReport method there creates a BS and sends a message to a BP outside of Ensemble context. You need to send an object and not a datatype, so in your example: Set tSC = tService.ProcessInput(datePurge,.output) Should be instead: Set message = ##class(Ens.StringContainer).%New(datePurge) Set tSC = tService.ProcessInput(message,.output) If you want to send a message to a BP or BO you can do that too, just create an Ensemble message and use SendSync or SendAsync to send it from BS: Set message = ##class(Ens.StringContainer).%New(datePurge) Set targetHostName = "Name of BP or BO" Set description = "My request description" // Set timeout = 10 // how long to wait for a Sync call response, skip to wait forever // Set tSC = tService.SendRequestSync(targetHostName, message, .response, timeout, description) Set tSC = tService.SendRequestAsync(targetHostName, message, description) That said, Ensemble hosts can run on schedule so you can use built-in Ensemble scheduler and not a system task manager.
go to post Eduard Lebedyuk · Sep 19, 2017 How does Vue.JS stacks against other popular JS frameworks like Angular2, React, etc.?
go to post Eduard Lebedyuk · Sep 19, 2017 I prefer %SQL.Util.Procedures because it is easier to use and it generates classes and methods that can be easily modified.
go to post Eduard Lebedyuk · Sep 18, 2017 Ensure that user, which you are using to access the database has apropriate permissions to connect and access data.
go to post Eduard Lebedyuk · Sep 17, 2017 I use markdowntopdf, but there are many online and offline services with the similar capabilities. I have created a release with PDFs.
go to post Eduard Lebedyuk · Sep 16, 2017 > Would you have three branches for the code or 3 repo's. Please describe differences between your DEV, TEST, PROD code. Still, I'd probably recommend one repo and 3 branches. >Would you have three projects in Atelier to communicate with the environments and GitHub? No, there would be one Atelier project for DEV. All other code propagation should be done automatically by Continuous Integration/Continuous Delivery solution.
go to post Eduard Lebedyuk · Sep 12, 2017 That may mean one of the several things:You're not specifying or specifyiong incorrectly one or several request header parameters. One of the most often encountered errors is not specifying ContentType as application/json.Request content is formed incorrectlyAnyway, to solve this problem you need to make a correct request to the target system, record it and compare to the Ensemble request. Here's an article on that.