EPM Customization

38
EPM Customization Taking your Microsoft EPM Solution Beyond the “box” EPM Customization Series Part 2 November 21st, 2007 Brendan Giles , PMP, MCP

description

EPM Customization. Taking your Microsoft EPM Solution Beyond the “box”. Brendan Giles , PMP, MCP. November 21st, 2007. EPM Customization Series Part 2. Acronyms. EPM - PowerPoint PPT Presentation

Transcript of EPM Customization

Page 1: EPM Customization

EPM Customization

Taking your Microsoft EPM Solution

Beyond the “box”

EPM Customization Series Part 2

November 21st, 2007

Brendan Giles , PMP, MCP

Page 2: EPM Customization

Slide Slide 22

Acronyms

EPM Enterprise Project Management – Centralized control,

Shared Resources, Portfolio / Project Reporting and tracking at the enterprise level.

VBA Visual Basic for Applications programming language

common to all Microsoft Office products including Microsoft Office Project.

PDS Project Data Service – Project Server 2003 API. XML based

request / reply. PSI

Project Server Interface – Project Server 2007 API. Web services based using ADO datasets and the .NET Framework.

SOAP Simple Object Access Protocol – Communication Protocol

used to transfer data in a Microsoft EPM Solution via Http.

Page 3: EPM Customization

Slide Slide 33

Overview

Microsoft Office Project Data Model Microsoft Office Project VBA Project Data Service API (Microsoft

EPM 2003) and Enterprise Data Maintenance

Project Server Interface (Microsoft EPM 2007)

Sharepoint Web Services Questions and Wrap-up

Page 4: EPM Customization

Slide Slide 44

Project Object Model

Page 5: EPM Customization

Slide Slide 55

VBA Benefits

VBA allows: Access to Microsoft Office Project Objects Access to other Office Applications Macro recordings to expose VBA Code Key data elements:

i. Project

ii. Task

iii. Task Time-Phased

iv. Resource

v. Resource Time-Phased

vi. Assignment

vii. Assignment Time-Phased

Page 6: EPM Customization

Slide Slide 66

VBA Code

Sub SavePlan(Share_Drive as String, Plan As String, SavedPlan As String)

'Retrieve the specified project plan from Project Server'and save it to the fileshare

FileOpen Name:="<>\" & Plan, ReadOnly:=True, _FormatID:="MSProject.MPP", Openpool:=pjDoNotOpenPool 'Don't Try to update this project on the server when I save it to a fileshare'besides it is read-only so it won't let you

FileSaveAs Name:=Share_Drive + ":\Latest Project Plans\" & SavedPlanFileClose pjSave

End Sub

Techie Alert

Page 7: EPM Customization

Slide Slide 77

VBA Retrieval of Assignments Time-Phased Data

For Each Assignment In Resource.Assignments ' Check if assignment is within our report range

If Assignment.Start <= EndOfPeriod _ And Assignment.Finish >= StartDate Then Set tsvs = Assignment.TimeScaleData(StartDate, EndOfPeriod, pjAssignmentTimescaledWork, pjTimescaleDays) Assignment_Remaining_Work_Hours = Assignment.RemainingWork / 60 For Each tsv In tsvs If tsv.Value <> "" Then Assignment_Work_Hours = tsv.Value / 60 'time is in mins ' Create a DBRecord Entry for this effort Add_DB_Assignment _ Project_Name:=Saved_Project_Name(prj.Name), _ Workgroup_Category:=Resource.EnterpriseOutlineCode4, _ Resource_Workgroup:=Resource.EnterpriseOutlineCode2, _ Resource_Name:=Resource.Name, _ Task_ID:=Assignment.TaskID, _ Task_Name:=Assignment.TaskName, _ Task_Start_Date:=tsv.StartDate, _ Task_Finish_Date:=tsv.EndDate, _ End If ' If tsv.value <> ..... Next tsv

End If ' If Assignment.Start <= .....

Next Assignment

Techie Alert

Page 8: EPM Customization

Slide Slide 88

VBA also Allows Office Integration

Set cnt = New ADODB.Connection With cnt .Open dbConnectStr 'Create the Assignments Table .Execute "CREATE TABLE Assignments_Table " & _ "([Assignment ID] COUNTER CONSTRAINT PrimaryKey PRIMARY KEY, " & _ "[Workgroup Category] Text(250) WITH Compression, " & _ "[Resource Workgroup] Text(250) WITH Compression, " & _ "[Resource Name] Text(250) WITH Compression, " & _ "[Project Name] Text(250) WITH Compression, " & _ "[Task ID] NUMBER, " & _ "[Task Name] Text(250) WITH Compression, " & _ "[Start Date] DATETIME, " & _ "[Finish Date] DATETIME, " & _ "[Assignment Remaining Work Hours] NUMBER, " & _ "[Assignment Remaining Work Days] NUMBER, " & _ "[Assignment Work Hours] NUMBER, " ' ' Create the Tasks Table ' .Execute "CREATE TABLE Tasks_Table " & _ "([Task ID] NUMBER, " & _ "[Project Name] Text(250) WITH Compression, " & _ "[Task Name] Text(250), " & _ "[Start Date] DATETIME, " & _ "[Finish Date] DATETIME, " & _ "[Task Remaining Work Hours] NUMBER, " & _ "[Task Remaining Work Days] NUMBER, " & _ "[Task Work Hours] NUMBER, " ‘End With Set cnt = NothingEnd Sub

Techie Alert

Page 9: EPM Customization

Slide Slide 99

VBA Object Model Changes

VBA changes in Project Professional 2007

Simplified custom fields and outline codes Multiple undo and redo actions Effective calendar dates and calendar exceptions Advanced desktop reporting using Visual Reports Task drivers and recalculation change highlighting to help clarify

scheduling processes Costs and budget Queuing Service events Importing of a Windows SharePoint Services 3.0 project Saving of a local copy of a Project Server project for sharing

Page 10: EPM Customization

Slide Slide 1010

Project Data Service

Steps to access all PDS Methods Logon to Project Server Programmatically using valid ID

and password Obtain Authentication Cookie Create a PDS Request in XML Call PDS Web Service with PDS Request and

authentication Cookie via a SOAP call Receive PDS XML Reply Parse PDS XML Reply

Page 11: EPM Customization

Slide Slide 1111

PDS Authentication Cookie

-<Reply><Hresult>0<Hresult><Cookie>(F55A3……..

</Cookie></Reply>

Page 12: EPM Customization

Slide Slide 1212

PDS Logon Cookieprivate void btnChkCookie_Click(object sender, System.EventArgs e)

{// Create a persistent cookie for the URL, if the cookie doesn't // exist or if the Project Server URL changes.

if (urlReset && ieCookiesOK) { CreateCookie(COOKIENAME, VALUENAME, txtMSPURL.Text, DAYSPERSIST);

urlReset = false; }

//Clear the listbox, for subsequent creations of the project listlblLogonStatus.Text = "";psLogonUrl = txtMSPURL.Text + "/LgnIntAu.asp";string textInReply = "";

if (Get_Cookie.LogonProjectServer(psLogonUrl, ref psCookie, ref textInReply)) { //Trace.Warn("Logon Okay"); lblLogonStatus.ForeColor = Color.Green; lblLogonStatus.Text = "Log on OK: " + txtMSPURL.Text; psURL = txtMSPURL.Text; //Check the PDS Call Here <----- }else { //Trace.Warn("Logon Failed");

//Trace.Warn(textInReply); lblLogonStatus.ForeColor = Color.Red; lblLogonStatus.Text = "Log on failed"; }

} Techie Alert

Page 13: EPM Customization

Slide Slide 1313

PSI Login via Web Service

public bool LogonPS(bool useWinLogon, string baseUrl, string userName, string password)

{ const string LOGINWINDOWS = "_vti_bin/PSI/LoginWindows.asmx"; const string LOGINFORMS = "_vti_bin/PSI/LoginForms.asmx"; bool logonSucceeded = false;

try {

if (useWinLogon)

{ loginWindows.Url = baseUrl + LOGINWINDOWS; loginWindows.Credentials =

CredentialCache.DefaultCredentials; if (loginWindows.Login()) logonSucceeded = true;

}

} // Catch statements

return logonSucceeded;

}

Techie Alert

Page 14: EPM Customization

Slide Slide 1414

Project Data Service

XML Based Request / Reply API Consists of:

Project Methods Enterprise Project Creation Methods Resource Methods Enterprise Custom Field Methods Timesheet / Assignment Methods Administrative Methods Version Methods

Page 15: EPM Customization

Slide Slide 1515

Enterprise Data Maintenance

Builds on the PDS to provide higher level data exchange

Uses “file drop” and SOAP programmatic interface

Adds a business layer mapping to integrate with existing Project server data

Tightly integrates Project server with other line of business applications

Resource data synchronization Project Team Synchronization Updating Custom field value lists

Page 16: EPM Customization

Slide Slide 1616

Microsoft EPM Solution 2003

Page 17: EPM Customization

Slide Slide 1717

Microsoft EPM Solution 2003

Page 18: EPM Customization

Slide Slide 1818

Microsoft EPM Solution 2007

Page 19: EPM Customization

Slide Slide 1919

Project Server Interface (PSI)

Web Services API using ADO.NET Datasets Over 350 Public Methods Firewall Friendly (Ports 80 and 443) Access via SOAP over Http Managed Code but supports managed and

unmanaged clients VB.NET, C#.NET and ASP.NET development Simply add a web reference

(http://servername/projectservername/_vti_bin/psi/..

Better Design Time Control

Page 20: EPM Customization

Slide Slide 2020

Project Server Interface (PSI)

Synchronous Methods aSynchronous (*Queue Methods) Bulk data changes Transactional / Restartable Over 100 Server Events to listen for ADO Datasets used for Data Transfer

Typed datasets that are familiar to developers and provide safety

Design Time Validation Improved Performance

Page 21: EPM Customization

Slide Slide 2121

Project Server Interface (PSI)

Page 22: EPM Customization

Slide Slide 2222

Project Server Interface (PSI)

Page 23: EPM Customization

Slide Slide 2323

Project Server Interface (PSI)

A Wealth of Web Services:

Admin Archive Authentication (Internal

Use)

Calendar

Cube Admin

Custom Fields

Events

Login Forms

LoginWindows

LookupTable

Notifications

ObjectLinkProvider Project PWA (Internal use)

QueueSystem

Resource

Security

Statusing

Timesheet

View (Internal Use)

WinProj (Internal Use)

WssInterop

Page 24: EPM Customization

Slide Slide 2424

Project Server Interface (PSI)

Simply add a web reference in Visual Studio (http://servername/projectservername/_vti_bin/psi/resource.asmx

Page 25: EPM Customization

Slide Slide 2525

Project Server Interface (PSI)

Simply add a web reference in Visual Studio (http://servername/projectservername/_vti_bin/psi/....

Page 26: EPM Customization

Slide Slide 2626

Project Server Interface (PSI)

View Web Service Properties:

Page 27: EPM Customization

Slide Slide 2727

Project Server Interface (PSI)

Expose the methods available ------ Retrieve data in an ADO DatasetPSI relies heavily on GUIDs (Globally Unique Identifier) in contrast to PDS that used IDs that were not always unique across Project Server Instances

Page 28: EPM Customization

Slide Slide 2828

Project Server Interface (PSI)

Page 29: EPM Customization

Slide Slide 2929

Project Server Events

Applications can listen for Project Server Events

Page 30: EPM Customization

Slide Slide 3030

Project Server Events

Applications can listen for Project Server Events

Page 31: EPM Customization

Slide Slide 3131

Project Server Interface (PSI)

Developers should not directly Access Project Server Databases other than the Reporting Database PSI Web Services and methods should be used

Page 32: EPM Customization

Slide Slide 3232

Sharepoint Web Services

Sharepoint Web Services give developers access to Sharepoint Sites and their content

Page 33: EPM Customization

Slide Slide 3333

Sharepoint Web Services

Windows Sharepoint Services 3.0 for EPM 2007 Ships with Windows Server 2003.

Page 34: EPM Customization

Slide Slide 3434

Sharepoint Web Services

Microsoft Office Sharepoint Server 2007 is recommended when using the workflow features of EPM 2007.

Page 35: EPM Customization

Slide Slide 3535

Sharepoint Web Services

Project Web Access is now a Sharepoint Site in EPM 2007

Page 36: EPM Customization

Slide Slide 3636

Fetching Issues via a Sharepoint Web Service

Techie Alert

Page 37: EPM Customization

Slide Slide 3737

Summary Customization of Microsoft EPM via:

Visual Basic for Applications Project Data Services API (2003) Project Server Interface (API) (2007) Sharepoint Web Services

Visual Studio

ADO.NET 2.0

.NET Framework

Page 38: EPM Customization

Slide Slide 3838

Questions and Answers

?? No such thing as a stupid question ?? Answers ---- we’ll try to have smart answers