Skip to main content

When scheduling a job as per the API example found here, a job object is returned that also contains a sessionID.

Is it possible to store this sessionID in order to later retrieve the status of the scheduled job? i.e. scheduled/running/finished.

 

EDIT:

To clarify, this is my problem:

  • Given: a server object and a (valid) sessionID
  • Goal: Create a Job object that I can use to retrieve the Job.Status property

How do I achieve this?

 

 

As a side question, but not my main focus, how do I get a list of all scheduled jobs (including finished ones) such as the overview you get when navigating to the ‘jobs page’ in the portal?

Using the Server.getCurrentJobs() method seems to only retrieve unfinished jobs.

For your first question, there is a Job.Status method/property for the job object. Does that not work ?


@mohansx Maybe my question is unclear. I will edit my original post.


@LowBjorn I’m not sure if the PRO API can interact with a job that was not created through the PRO API.

For your use case, can you check if the given sessionID exists in the return list of server.getCurrentJobs() ? If that sessionID is not in that list, then it would mean that job is either completed (successfully or otherwise).


Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator