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

 Here's how:

  1. SMP > Ensemble > Production Configuration > Your Business Service > Settings > Additional Settings > Schedule > Press on the the looking glass
  2. In Schedule Spec Editor press "New"
  3. Specify Schedule name and press OK
  4. Set "Raw String" schedule or use "Add action" specify a schedule
  5. Press "Save spec"
  6. Schedule setting in your Business Service should be set now
  7. Restart your Business Service

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)}

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.