Scheduling API, SchRetrieve

I have a problem with the scheduling API functions.

Calling the SchRetrieve function I retrieve schedule lists for a number of previously specified users in a TEXT_LIST.

With the Schedule_ExtractSchedList function, I retrieve a SCHED_LIST that contains a list of schedules (SCHED_ENTRY) for a certain user. Is there a way to explicitly check WHICH user the SCHED_LIST is for?

The schedule lists seem to come in reverse order from the order entered in the TEXT_LIST, so you would think you can keep track of which schedules belong to which users that way.

BUT there is a problem here, it seems that a SCHED_LIST is not returned for all requested users (even though no error is specified), the number of SCHED_LISTs does not seem to match the number of requested users. So going by the method above of reverse order, schedules are mismatched as belonging to the wrong user.

Hence my question, is there a way to explicitly decide which user a certain SCHED_LIST or SCHED_ENTRY belongs to?

Subject: Answers

With the Schedule_ExtractSchedList function, I retrieve a SCHED_LIST that contains a list of >schedules (SCHED_ENTRY) for a certain user. Is there a way to explicitly check WHICH user the >SCHED_LIST is for?

If you are using the C API I strongly recommend you take a gander at the sample API toolkit program in the samples\misc\schedule subdirectory. It shows you how to accurately use the API calls.

The schedule lists seem to come in reverse order from the order entered in the TEXT_LIST, so you >would think you can keep track of which schedules belong to which users that way.

Actually the data is returned in a semi organized manner. All data for ‘local’ users is returned immediately in the order the names occur in the list (assuming we did not have to rewrite them like Jane Smith/Acme → Jane Doe/Acme). Then the data comes back in whatever order it is returned from the other servers whom the request is sent out to. That can vary based on network latency, their response times, the number of domains we have to hop and other similar factors.

BUT there is a problem here, it seems that a SCHED_LIST is not returned for all requested users >(even though no error is specified), the number of SCHED_LISTs does not seem to match the number >of requested users. So going by the method above of reverse order, schedules are mismatched as >belonging to the wrong user.

You should NOT go by ordering to match users to data! Get the name from the container.

The busytime system will automatically expand server groups so if you ask for “Nonis’s Team” on the request you will get back the busytime data for every member of that group (and any subgroups).

Bruce

IBM

Subject: More questions

Hi Bruce,

thanks for your answer and sorry for taking so long to reply.

I appreciate your explanation of how the list of schedules is ordered it was very enlightening.

The sample you mention is what I have based my application on, but in that sample they only get schedules for ONE single user, and they use a global variable to keep track of what user it is. So it didn’t help me much…

However when you wrote “get the name from the container” I started looking around at the different data types that are returned and I found the SCHEDULE type, which contains an owner name!

Thanks so much for your help.

Regards,

  • Nonis