
module description and icon added
Class to setup tasks running at schedule
USER>zpm "install iris-cron-task"
Import the class into your system.
Clone/git pull the repo into any local directory
$ git clone https://github.com/intersystems-community/objectscript-docker-template.git
Open the terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d
Open IRIS terminal:
$ docker-compose exec iris iris session iris
USER>
Run "set ^A($I(^A))=$H" every minute:
USER>zw ##class(dc.cron.task).Start("* * * * *","s ^A($I(^A))=$H",1,.taskId)
taskId contains the id of the task created: UZER>w taskId 1000
It will store in a global ^A the something like the following: USER>zw ^A ^A=6 ^A(1)="65732,54180" ^A(2)="65732,54240" ^A(3)="65732,54300" ^A(4)="65732,54360" ^A(5)="65732,54420" ^A(6)="65732,54480"
Run "set ^B($I(^B))=$H" every hour:
USER>zw ##class(dc.cron.task).Start("0 * * * *","s ^B($I(^B))=$H",1,.taskId)
Run "set ^A($I(^A))=$H" every day at midnight:
USER>zw ##class(dc.cron.task).Start("0 0 * * *","s ^C($I(^C))=$H",1,.taskId)
And you can delete the task when you don't need it anymore.
USER>zw ##class(dc.cron.task).Kill(taskId)
You are very welcome to collaborate and make changes. Fork the repository and send Pull Request.
Below I describe how to make changes in ObjectScript part:
Make sure you have git and Docker desktop installed.
This repository is ready to code in VSCode with ObjectScript plugin.
Install VSCode, Docker and ObjectScript plugin and open the folder in VSCode.
Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.
Feel free to delete PackageSample folder and place your ObjectScript classes in a form /src/Package/Classname.cls Read more about folder setup for InterSystems ObjectScript
The script in Installer.cls will import everything you place under /src into IRIS.
The simplest dockerfile which starts IRIS and imports code from /src folder into it. Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
Settings file to let you immedietly code in VSCode with VSCode ObjectScript plugin)
Config file if you want to debug with VSCode ObjectScript
module description and icon added
Kill method introduced
Initial Release