PS 2007: QueueArchiveProjects and asynch mode
-
20 September 2010 10:41
Hi experts,
in order to create a console app that schedule a weekly backup of projects in my environment, i try to use QueueArchiveProjects method in webService Archive. This method generate several job, so i have no Guid[] array to get how many projects are backupped.
I try to use asynch statement in order to read (and conunt) my jobs status, but in my test this don't work.
I try also with other statemente QueueArchiveEntityAsync but also if job is completed in queue, the execution don't firing completed delegate.
Xes:
private void g_archive_QueueArchiveCustomFieldsCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { console.Write("Ok man!!"); } ..... g_archive.QueueArchiveCustomFieldsCompleted += new QueueArchiveCustomFieldsCompletedEventHandler( this.g_archive_QueueArchiveCustomFieldsCompleted); Guid l_jobGuid = Guid.NewGuid(); g_archive.QueueArchiveCustomFieldsAsync(l_jobGuid); QueueSystem.WaitForQueue(l_jobGuid);
So, i have two questions:
1) In your opinion, is it possible (and how) get the number of the project backupped correctly for send a report?
2) Do you know some samples with asynch exec with this type of statements?
Thank you,
Cheers,
Paolo O.
Semua Balasan
-
21 September 2010 7:14Moderator
Hi Paolo,
I haven't done archiving using PSI yet, but let me try to help you.
I don't think there is an easy way to retreive the number or projects that have been archived.
Have you checked the 'ReadArchivedProjectsList' method? I've never used it myself, but maybe you can find the information you need in here (list of projects and archive date?)?If not, you could control the archive process, by archiving each project one-by-one using the QueueArchiveProject method.
I hope this helps,
Hans
My EPM blog: Projectopolis- Disarankan sebagai Jawaban oleh Brian Smith - MSFTMicrosoft Employee, Moderator 24 September 2010 22:40
- Ditandai sebagai Jawaban oleh Paolo Olocco 27 September 2010 21:04
-
27 September 2010 21:03
Hi Hansh,
i apologize for delay of this answer.
I have tried several ways to reach my goal with these methods but without success. There is also no event handler for backup events.
So, in my specific case i create a simple console app that launch Backup immediatly for projects entity. Again, i have also a scheduled app that run after about an hour the first console app and with ReadAllMyJobs method of Queue Webservice, filter all backup job, count they and send an email with this number and report error jobs, if any.
Maybe, i'm sure, it's not a beautiful solution, but it works. :)
Thank you
Cheers,
Paolo O.