Friday, March 30, 2007
PS2007 Task Duration Calculation (based on Days)
This is just a short blog to comment on a little problem I recently ran into regarding updating the duration for a task using the PSI. The problem was 8 inches from the screen (i.e. me) however I thought I would blog about it to save someone else the problem (embarrassment). When adding a task duration to the ProjectDataset.TaskRow object the figure has to represent tenths of minutes as specified in the SDK class documentation. Here is a complete copy of my CreateTask function. Please note the example is written in C# and based on a strongly typed TaskDetails object.
public static void CreateTask(Proxy.ProjectDataSet dataset, int projNum, Proxy.TaskInfo TaskDetails, string name, Guid taskGuid)
{
Proxy.ProjectDataSet.TaskRow taskRow = dataset.Task.NewTaskRow();
taskRow.PROJ_UID = dataset.Project[projNum].PROJ_UID;
taskRow.TASK_UID = taskGuid;
TimeSpan span = TaskDetails.EndDate.Subtract(TaskDetails.StartDate);
int Days = span.Days;
taskRow.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.Day;
taskRow.TASK_DUR = (Days * 4800);
taskRow.TASK_NAME = name;
taskRow.TASK_START_DATE = TaskDetails.StartDate;
taskRow.TASK_FINISH_DATE = TaskDetails.EndDate;
//TaskDetails.Config_Position;
taskRow.TASK_PRIORITY = int.Parse(TaskDetails.Priority);
//TaskDetails.Project_Code;
taskRow.TASK_CONTACT = TaskDetails.TaskOwner;
//TaskDetails.WO_Code;
dataset.Task.AddTaskRow(taskRow);
}
Please note that line taskRow.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.Day only specifies how the duration will be displayed in the Project Server interfaces (PWA & Project Prof).
The 4800 figure should be changed based on the standard working hours in your project calendar. If the calendar used has a different number of working hours you will need to update this figure based on the following calculations:.
Here is how you get to 4800 to represent tenths of a minute.
Standard calendar = 8 hrs per day
8 Hours = 480 minutes
X10 = 4800 tenths of minutes
This presents a problem with maintainability but that is a configuration issue and something you will need to handle separately.
public static void CreateTask(Proxy.ProjectDataSet dataset, int projNum, Proxy.TaskInfo TaskDetails, string name, Guid taskGuid)
{
Proxy.ProjectDataSet.TaskRow taskRow = dataset.Task.NewTaskRow();
taskRow.PROJ_UID = dataset.Project[projNum].PROJ_UID;
taskRow.TASK_UID = taskGuid;
TimeSpan span = TaskDetails.EndDate.Subtract(TaskDetails.StartDate);
int Days = span.Days;
taskRow.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.Day;
taskRow.TASK_DUR = (Days * 4800);
taskRow.TASK_NAME = name;
taskRow.TASK_START_DATE = TaskDetails.StartDate;
taskRow.TASK_FINISH_DATE = TaskDetails.EndDate;
//TaskDetails.Config_Position;
taskRow.TASK_PRIORITY = int.Parse(TaskDetails.Priority);
//TaskDetails.Project_Code;
taskRow.TASK_CONTACT = TaskDetails.TaskOwner;
//TaskDetails.WO_Code;
dataset.Task.AddTaskRow(taskRow);
}
Please note that line taskRow.TASK_DUR_FMT = (int)PSLibrary.Task.DurationFormat.Day only specifies how the duration will be displayed in the Project Server interfaces (PWA & Project Prof).
The 4800 figure should be changed based on the standard working hours in your project calendar. If the calendar used has a different number of working hours you will need to update this figure based on the following calculations:.
Here is how you get to 4800 to represent tenths of a minute.
Standard calendar = 8 hrs per day
8 Hours = 480 minutes
X10 = 4800 tenths of minutes
This presents a problem with maintainability but that is a configuration issue and something you will need to handle separately.
Friday, October 20, 2006
IE 7 - Missing drag links
I still consider IE 7.0 is missing one killer feature that I love about firefox. I would love to be able to drag a link from a page being viewed to the tabs area and either drop it on an existing tab or create a new tab. Otherwise I think the new browser from MS is great and will finally put an end to all those open windows and the naf grouping in the desktop toolbar. Of course I would probably just use Firefox if MS would ensure that the javascript they used on dynamic pages worked in that browser. I can't see that happening any time soon though.
Thursday, May 11, 2006
Project Manager field - Project Server 03
The project managers field is input in the file properties dialog in Project Professional. It is called the author field. This maps backs to the project server database in the msp_projects table and is located in the proj_prop_manager field.
Friday, May 05, 2006
Rename a published project - Project server 2003
Some notes on the process to rename a published project in Microsoft Project Server 2003. First off download the Rename Project Tool from Microsoft. Next you will need to install the tool on the machine running project server. In the installation guide, I have always created an additional registry key for the PDSRights.CPDSRights value, incrementing the string PDSExtensionExN increasing N by 1. This is regardless of whether there is already PDS extensions installed on the machine. (That will make more sense when you're actually installing the tool and referencing the guide). There is some confusion about required security credentials required to Logon to the Project Server using the tool. It has always worked for me using the server administrator account, however the Trusted Connection checkbox will generally allow you to overcome logon failures! Also make sure that all updates have been processed for the project in question - check this with the project manager and resources.
It is merely then a case of running the tool and choosing the project you wish to rename.
The additional step not documented by Microsoft is to update the Windows SharePoint Services site with the new project name. To do this you logon the WSS site with an administrator account and do the following:
1. Go to Site Settings.
2. Under Customization select Change site title and description.
3. Modify the title and click OK.
I really don't consider this tool should be installed on project manager's machines as the installation is not clean and usability is not well considered. This should remain a tool used by System Administrators and IT staff. If you are looking for a more user friendly way to rename projects then check out the Project Renamer add-on from Bogdanov and Associates. This tool claims to integrate nicely into Project Web Access. I guess if your organisation renames a lot of projects then the investment in an add-on like this could be justified.
It is merely then a case of running the tool and choosing the project you wish to rename.
The additional step not documented by Microsoft is to update the Windows SharePoint Services site with the new project name. To do this you logon the WSS site with an administrator account and do the following:
1. Go to Site Settings.
2. Under Customization select Change site title and description.
3. Modify the title and click OK.
I really don't consider this tool should be installed on project manager's machines as the installation is not clean and usability is not well considered. This should remain a tool used by System Administrators and IT staff. If you are looking for a more user friendly way to rename projects then check out the Project Renamer add-on from Bogdanov and Associates. This tool claims to integrate nicely into Project Web Access. I guess if your organisation renames a lot of projects then the investment in an add-on like this could be justified.
Enterprise Library 2.0 - Hands on Labs
These labs have now become available here. For any .Net developers still doing cross cutting business logic other ways I would encourage you to try out Enterprise library. At a high level it is useful for (in no order of priority):
- Auditing
- Logging
- Configuration
- Security
- Data Access
- Exception Management
I basically wanted to post this on my blog as I am constantly amazed at the number of .Net developers that I speak with who have near used this set of tools. For mine this continues to be the crowning glory for the MS patterns and practices group.
Friday, April 28, 2006
Pair Programming
A few year ago I had the opportunity to work in a pair programming environment. After that experience I have always believed that in the right circumstances, pair programming increases productivity and more importantly, the quality of deliverables.
Fundamentally the decision to allocate pairs to a task should not be collaboratively made by the development team, but rather made by the architect / manager based on feedback from team members. Some of the considerations an architect needs to consider include:
Fundamentally the decision to allocate pairs to a task should not be collaboratively made by the development team, but rather made by the architect / manager based on feedback from team members. Some of the considerations an architect needs to consider include:
- Complexity of task
- Capability of the programmer(s)
- Competing priorities
- appetite for quality and therefore risk mitigation
This success of pair programming also relies on the management taking a proactive view on quality outputs. Which ever way you slice quality considerations, it makes for a better business. The difficulty is that too many manager's are focused on quick turn arounds and quick wins. I some words of advice for those managers, A sustainable business has to be built on quality! Jonathan Cogley ran an interesting little experiment on this subject. Check out his blog here.
Tuesday, March 28, 2006
BizTalk 2006 RTM
Caught this on BizTalkBills blog. Everyone without an MSDN subscription will have to wait for another month or so for the full product release.
Subscribe to:
Posts (Atom)