Question Veerraju Grandhi · Jun 16, 2024

How to get Task Status through IRISNAtive/Python

Hi,

After  executing a task using RunNow() method of class %SYS.task i am not able to find suitable method for getting the status in %SYS.Task class. Please help how to get the task status throuhgh Python/IRISNAtive for Python combination

Comments

Enrico Parisi · Jun 16, 2024

What kind of task? Does your task provide a return status?

If what you need is displayed in the Error column in the "Task History" page in Management Portal, then you can use the query:

select Error from %SYS_Task.History where Task = <YoutTaskID>

0
Veerraju Grandhi  Jun 16, 2024 to Enrico Parisi

Hi Enrico, Yes, through SQL i am getting but i am not finding suitable class/method for getting the task status. My task is just a backup task and i just want to see the task schedule status. 

0
Jon Willeke · Jun 20, 2024

If I understand correctly, you want the Status property of a given task. In that case, this is going to be similar to your other question about fetching the gmheap property, except that you'll call a slightly different method to open the object:

task = native.classMethodValue('%SYS.Task', '%OpenId', id)
task.get('Status')

Since you're able to call RunNow(), I assume that you know the ID of the task. The same idea will work for the Error property.

If you're stuck with the ancient 1.0.0 wheel for some reason, you'll have to write helper class methods of your own.

0
Veerraju Grandhi  Jun 20, 2024 to Jon Willeke

Thanks jon. Actually i used sql query to fetch the status. So i got some alternative. Thanks for all the guidance. 

0