180 likes | 376 Views
EPM 2007 Server-Side Events. A Statusing Example. msepm.hsquared.be. Agenda. Eventing Architecture Server-side events and the Queue Creating an Event Handler A statusing example Deploying an Event Handler Event Handlers and config files. Eventing Architecture.
E N D
EPM 2007Server-Side Events A Statusing Example msepm.hsquared.be
Agenda • Eventing Architecture • Server-side events and the Queue • Creating an Event Handler • A statusing example • Deploying an Event Handler • Event Handlers and config files
Eventing Architecture • Eventing Service is part of core SSP application • Event Handlers in WSS config DB at PWA site level • Independent event handlers for each PWA • PWA includes Event Catalog to manage custom Event Handlers • Multiple event handlers possible • Pre and post events
Event Handler: sequence Event Source Event Handler Call PSI method Raise Event Event Arguments Invoke Event Handler Cancel pre-event Modified Event Arguments Run custom code End Continue
Pre/Post events and the PS Queue • Pre-events • fired when the Queue job is about to start • NOT when you perform the action! • Post-events • fired when the queue job completed successfully • If queue job fails or is cancelled, the post-event will not fire
Pre/Post events and the PS Queue • Exceptions • Some PSI calls have no corresponding queue job • Pre-event fired before action is performed • Post-event fired after action completed • Ex.: StatusingStatusUpdating, StatusingStatusUpdated
Creating an Event Handler • Create a class library project • Set references • Microsoft.Office.Project.Server.Events.Receivers.dll • Microsoft.Office.Project.Server.Library.dll • Develop the event handler code • Deploy the event handler • Register the event handler with Project Server using Project Web Access
Demo Creating a Project Server custom Event Handler
Statusing limitations • Only published updates in Reporting DB • Not possible to report on ‘missing’ updates • Difficult to implement task update checks • Impossible to detect 0h registrations • No incremental export possible
Event Handler solution • Insert task updates in a custom DB • Add status to keep track of approval status • Saved, submitted, accepted, rejected • Add timestamp and/or export state • Allows for incremental exports
Event Handler solution EPM 2007 DB • Task Updates • Save Event Service Queue • Task Updates • Submit • Accept • Reject Custom DB
Demo Creating a custom Statusing solution
Other scenario’s • Building an incremental export module • Building a real-time export module • Real-time timesheet reporting • No more waiting for queue • Use pre-event to implement task update quality checks
Remarks • NOT a replacement for out-of-the-box statusing flow • Go in and out • Events stop normal code execution. Make sure you don’t add delays! • Keep an eye on performance! • Might be necessary to offload the custom DB to a dedicated server
Deploying the Event Handler • Two options • GAC • Shared assembly • Sign with strong name key! • Bin directory • Code isolation • Register Event Handler in PWA
Configuration File • Event Handler = assembly • No assembly config file • Add configsource to config of calling .dll • Microsoft.Office.Project.Server.Eventing.exe.config • <appSettingsconfigSource=“NameOfYourEventHandler.dll.config"></appSettings>
Demo Event Handler and Configuration File
Questions ? • http://msepm.hsquared.be • Slideshow • Partial Code Sample • Project 2007 SDK