Add new scheduler: Pull data from URL

Hello,

I think DHIS2 could benefit from a new kind a scheduler: pull data from url

context: @plinnegan from BAO systems made a very interesting app PDAC, it serve via an API an dataset generated from program but the apps cannot create scheduled task, and I don’t see how the existing scheduler could do the trick

In order to have something a bit generic I was think of a schedule task that could:

  • call an endpoint defined at the creation of the instance of the scheduled task
  • possibility to have a variable to define the kind of period + offset (bit like in program indicator boundaries)
  • forward the payload to another endpoint in DHIS2 (Ideally without credential required, maybe just username of the person creating the task)
  • support paginated data

possible usages:

  • PDAC
  • sync between to DHIS2 instances only for specific data
  • pull import from other systems

advantage:

  • no need of another app for the scheduling
  • no need to configure username in thirdparty systems

I will try to develop this but I am not so familiar with Java so it might take a while before it’s done and I’d like to have the feedback of the community/dev to see it it would actually make sense for others

br

3 Likes

Hey @pmpdelcroix,
Thanks for sharing! I wonder if it’s then be possible to allow the app to create scheduled tasks rather than having to do it from the DHIS2 instance so long as it’s connected to the instance? :smiley:

It’s also possible to create a feature request if you think it’ll be helpful for the whole community, and you’ll be able to see how the idea is developed while you’re becoming more familiar with Java. Thanks!

Hi @pmpdelcroix,

I agree this would be a great feature and would increase the usefulness of the PDAC app further if the data transfer could be automated. As far as I know @Gassim there is no way for DHIS2 web apps to create cron jobs, so this is not something possible with the app platform currently.

Best,
Pete

2 Likes

Hi,

Before doing any development I am thinking of what will be the best approach,

I am thinking that the easiest and most powerful approach will be to have a schedule task that will start a script (javascript) in a sandbox with the credentials to use, the “calculated” period and “manual” config (like urls … ) as parameter.

With that approach I hope that the DHIS2 app could be able to create their own scheduling tasks (the credential to use and manual config would be set by the apps), what do you think ?

Best regards

2 Likes

Great feature suggestion @pmpdelcroix and thanks for the input @plinnegan !

This is on our radar as something we’d like to add - both defining scheduled jobs when installing an application and also supporting dynamic, sandboxed server-side functions which can be triggered by the scheduler (or via API extensions). Would love your feedback as we work to add this feature, I’ll add more details here when we get it onto our official roadmap!

3 Likes