User Answers

FOR CE ONLY.

I recommend creating non-production namespace with one database and calling

set sc = ##class(%EnsembleMgr).EnableNamespace(namespace, 1)

 

You need to check access to table.

Try

write $SYSTEM.SQL.CheckPriv($username,"1,<TABLE>","a")

Replace <Table> with your table.

Check Purge method of Ens.MessageHeader class for example. Here's how it determines cast-off date:

set %tDoNotDeleteDate = $$$timeUTCHtoUTC($s($ztimezone'<0:($H-pDaysToKeep+1)_","_($ztimezone*60),1:($H-pDaysToKeep)_","_($ztimezone*60+86400)))

So 24 hours.

Preface macro with /// to enable autocomplete:

///
#define $$$In...

What's the use case? I think it's better to keep independent tasks separate.

Anyway:

1. Create your own task class by extending %SYS.Task.Definition.

2. Program your task

1) Yes.

2) Use zwrite command for debugging and key access to get individual values:

zwrite tSettings
set value = tSettings("MySettingName")

Note, that if you want production host settings, you'll need to use GetHostSettings method from the same class.

You can store list properties same as array properties:

Property Collection As list Of ICT.Experiments.B(SQLPROJECTION = "table/column", STORAGEDEFAULT = "list");

Note that you need first to delete class storage if any exists and either recreate or move the data to comply with the new storage.