Answered by:
Register events with external application

Question
-
I need to update a project's data in my application when it is being updated in the Project Server. Is post-events the way to go? Is there a different way to do this?
Wednesday, November 30, 2011 8:25 PM
Answers
-
Hi Ramoadi,
Unfortunately the eventing model in Project Server does not implementent the IObservable Interface. If you are not allowed of registering your event handler in project server, the last option you have is to query the data for changes in a time intervall and "find" your event in this way.
Technically the best option is to use an eventhandle in the way, we've pointed out. If rules forbid that you are stuck.
Regards,
Stefan- Proposed as answer by Stefan Pirer Thursday, December 1, 2011 2:36 PM
- Marked as answer by ramoadi Thursday, February 2, 2012 4:43 PM
Thursday, December 1, 2011 2:36 PM
All replies
-
I guess what I'm trying to say is: Is there a way to register my application with the psi events?Wednesday, November 30, 2011 8:51 PM
-
Hi,
Your perfectly right with looking into the event handling model. I don't exactly know what you mean with register your application in the PSI events.
What you can do is to create an event handler for the ProjectUpdated event that pushes the data into your application.Regards,
Stefan
Wednesday, November 30, 2011 9:34 PM -
The problem is that I am not allowed to make any changes in the Project Server.
So when I was asking if I can register my application, I was wondering if the Project Server implements the Observable pattern. If it would ... I could implement an Observer in my app, so when it gets notified about a change, I could pull the new data in my app.
What do you think?
- Edited by ramoadi Wednesday, November 30, 2011 10:25 PM
Wednesday, November 30, 2011 9:46 PM -
Hi there,
You can write a server side event handler onPublished event & get the desired info either inserted in a custom database or as an XML & pull the data based on your requirement.
Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82Thursday, December 1, 2011 6:53 AM -
Hi Ramoadi,
Unfortunately the eventing model in Project Server does not implementent the IObservable Interface. If you are not allowed of registering your event handler in project server, the last option you have is to query the data for changes in a time intervall and "find" your event in this way.
Technically the best option is to use an eventhandle in the way, we've pointed out. If rules forbid that you are stuck.
Regards,
Stefan- Proposed as answer by Stefan Pirer Thursday, December 1, 2011 2:36 PM
- Marked as answer by ramoadi Thursday, February 2, 2012 4:43 PM
Thursday, December 1, 2011 2:36 PM -
Hi guys,
Thank you for your advice so far.
I have tried to get access to the PS, but no success, so I will have to do it by regularly checking for changes.
Could you give me some guidelines on how I could accomplish it?
Is there an event log that would tell me which projects have been added/changed/deleted and when?
Could you direct me to some sources of information on this or some code examples?
I appreciate your help.
- Edited by ramoadi Thursday, December 1, 2011 7:18 PM
Thursday, December 1, 2011 7:18 PM -
I am doing something like this.ProjectDataSet.ProjectDataTable newProjects=new ProjectDataSet.ProjectDataTable();foreach(ProjectDataSet.ProjectRowChangeEvent chEvent in projectsDs.something){if (chEvent.Action== DataRowAction.Add) {newProjects.AddProjectRow(chEvent.Row);}}Am I on the right track? If yes, what should the something be, because I didn't see an Events table, and the dataset by itself is not iterable.Thursday, December 1, 2011 7:59 PM