Using Batch file to trigger Scheduler

Hi there,

We have created a scheduler to burst out report using Canvas, the scheduler is working fine!

But now we wanted to do a self trigger, and do not want to login to the Admin Page manually due to security reason, as well as ease of use of the application, an idea now is to use TM1Web as a portal (security friendly, everything is logged) to do the self triggering.

The question is if it is possible to do it via a batch file, if so, how would I do that?

Regards

Tat

Hi @twong,

No, you can’t call the bursting by a batch file. You can use the web service in Canvas but you will need log in with the Admin credentials as part of the request.

That can also do, do you have sample code?

I guess I can write powershell script to make it work.

Hi @twong

We will need to dig that out next week.

Hi @twong

Also note, it isn’t a public API so you will need to use it at your own risk. It may change in future versions.

Totally understand, and I guess this is controllable for us too, as we will upgrade Canvas ourselves and will definitely do test on every upgrade.

Hi @twong,

You could create a Canvas page that you can call from an HTTP tool that you prefer. On the Canvas Help page, there are $tm1Ui functions that should be able to help you out on this.

  1. applicationAdminLogin(username, password)
  2. applicationAdminLogout()

Then for running the tasks themselves:

The idea would be for the above to be setup and called on the page’s Controller.

So in theory, you can run it via:

GET < Canvas Application >/#/canvas-execute-service-page?taskId=#######

The task id that you need to pass into those services is the one at the URL when you open up the task you have created on your Canvas Application’s Admin page:

image

It is up to you how you want to secure the admin username, password and the taskId that you will use on the page. The above is just an example where the TaskID is passed as a parameter, and the admin username/password is securely hidden and retrieved within the script.


Paul