Extending the Branching Workflow with Approvals

With Project Server 2010 you get an out of the box workflow named ‘Sample Proposal Workflow’, this is quite a good demonstration as it includes all of the usual things you might see in such a process; Validation, Approval, Selection, etc. However unfortunately as of this time (days before RTM) the source for this sample is still not available, at the moment the only SDK example is a simple Branching Workflow which only includes a single validation step.

I had an opportunity at the Sydney Ignite to ask Jan Kalis about this one, and he assured me that the full source for the sample will be released sometime around RTM, but we’ll have to wait a little bit more for that one.

In the meantime the world moves on and I have been busily writing my first full blow demand management workflow for a customer deployment, and so I thought I would share some of what I have done here. To that end I have taken the SDK Branching Workflow and extended it to include an Approval stage similar to that in the Sample Proposal Workflow.

Read below for what I have done and what you need to test it for yourself, then download my Visual Studio 2010 project below.

Branching Workflow with Approval:

The steps below are a summary of the changes made to the Branching Workflow, for a more complete how-to guide I very strongly suggest that you read the SDK Branching Workflow article and if you complete the examples there you will end where my steps below begin. Furthermore all the general requirements for getting this running (Visual Studio 2010 etc) are in the SDK article.

Before you start (or download):

This example is built on a default PWA instance, I have renamed the out of the box Sample Proposal Workflow to ‘Branching Workflow with Approvals’ then after deploying the code changed the workflow selected to the new one. All other PDPs and Stages are used as is, and the only other change required is an optional one below in step 5 below (see image).

Changes Made:

  1. Starting with the SDK Branching Workflow (note that if you download it in the p14betasdk then the code is incomplete and a few steps from the MSDN article must be completed). I also renamed the Feature and the Workflow in the deployment package to avoid confusion.
  2. Then I added a pre-build event command to automatically regenerate the Strong Name. (Can be removed, but just makes testing easier)
  3. Added a step after the Proposal Details Stage where the workflow goes to Proposal Selection Stage in Select Phase (updateProjectStageStatus20 – Waiting for Approval) – Note I have used the Select phase as my ‘Approval’ phase, I am not doing anything with Portfolio Selection here just approval.
  4. Next I read the Project Properties of "Project Name" and "Owner" for the Workflow Task (These are optional and just for completeness).
  5. Read "Portfolio Managers" Project Server Group membership to create approval request for first person returned in group.
  6. Create Workflow Task using CreateTaskWithContentType and assign to approver and populate task properties with Project Name and Owner.

Important: In order for these task properties to work you must ad the built in Columns to the PSWApprovalTask content type by editing the Default Workflow Approvals, then updating the content type to include the existing list columns.

(See Screenshot from List Settings PSWApprovalTask Content Type Properties)

clip_image001

  1. Then we add a while activity onTaskChanged to wait for the Approval task to be actioned. In this step the ExtendedProperties are checked for a value "Approved" anything else results in Rejection.
  2. And finally an IfElseActivity is used to branch on the Approved / Rejected result.
    1. If true then continue to end and UpdateProjectStageStatus to Execution stage.
    2. Else UpdateProjectStageStatus to Not Selected state and Terminate.

Here is the result in Visual Studio:

BranchingWorkflowApproval

What’s left?

  • Email notification? You can simply use the SharePoint list notifications on the Workflow Task list as a simple and consistent email notification method.
  • Portfolio Selection? I’ll leave that one to you.

 

Technical Details:

This example was created on the following beta software, meaning that things might change by RTM:

  • SharePoint Server 2010 RC Build
  • Project Server 2010 RC Build
  • Visual Studio 2010 RC Build

Download the full project files in a zip here. (*see update below)

 

MSDN References:

How to: Create a Branching Workflow <http://msdn.microsoft.com/en-us/library/ee767701(v=office.14).aspx>

Step 3: Create the Workflow <http://msdn.microsoft.com/en-us/library/ms580283.aspx>

 

UPDATE 3/09/2010:

I thought that I’d revisit this one as clearly from the comments there was something wrong after RTM, basically the problem everyone seems to be having relates to the ‘WorkflowTaskCTypeID’ defined. Somehow what I had in the BranchingWorkflow.cs file is actually incorrect, the solution has the following on line 46:

public String WorkflowTaskCTypeID = “0x0108010038A52C27344148C9B9214F82C7C0298500544602C73FFD1245BCC090442C85426B”;

When it should be:

public String WorkflowTaskCTypeID = “0x0108010038A52C27344148C9B9214F82C7C02985?;

Not quite sure where the first one came from (and why it worked?!) but that fixed it for me. If you update that line then recompile / rebuild you should be good.

 

PS. I don’t use the CreateTaskWithContentType anymore, have a look at the 2010 workflow activity (OfficeTask class) used in the Sample Proposal found in the SDK: http://msdn.microsoft.com/en-us/library/microsoft.office.workflow.actions.officetask.aspx

Share and Enjoy !

Shares

2010 Analysis Services Setup – No More Repository!

One thing I had been thus far unable to find out with 2010 and SQL AS is what’s changed with regards to the repository and DSO configuration, didn’t seem to be much specific mention in TechNet and I have seen a few posts indicating that the setup procedure is the same. (As in here.)

Well I just quickly tested and realised that it the whole configuration of the repository and DSO settings is no longer necessary! Hurrah! No more manually creating the repository database, and thank you MS for getting rid of the option to use an MDB repository!

Now that it’s 2010 we can finally get rid of some of those 90’s technologies..

Share and Enjoy !

Shares

PS2010 SQL Performance Setting

Been reviewing the MS documentation on 2010 in preparation for my first production 2010 deployment, and found this little titbit in this TechNet Article under ‘Enable the common language runtime’.

Use the following SQL script to improve Project Server performance, quote: “Enabling the common language runtime provides a significant improvement in performance for custom field operations.”

sp_configure ‘clr enabled’, 1
go
reconfigure
go

Simple enough, just open SQL Management Studio, connect to your SQL server and select New Query then paste and run that.

Share and Enjoy !

Shares

Project Details Web Part Error When Using Host Headers

This was an issue that I spent a good amount of time working with a customer on; when you add the Project Server web-parts to other SharePoint sites in other web applications, in some cases the Project Center / Project Details webpart will give the following error always:

"Project Center cannot access the project(s) you are trying to view. It is most likely that you either don’t have permissions to view the project, another user has deleted this project(s) before you were able to view it or that another user is in the process of publishing the project."

clip_image001

Quick note: The webpart can be added to other sites using the steps discussed here by Christophe.

After a long investigation the problem was found to be a repeatable issue caused by the use of Host Headers in the Alternate Access Mapping configuration of the SharePoint farm.

In short; when the PSI URL configured in the .webpart XML web part configuration file and / or the site in which the webpart has been added uses a host header other than the NETBIOS name, then this problem will occur.

All other Project webparts work without issue, Reminders, My Tasks, etc although I have not tried them all, I might guess that the Resource Center webpart would have the same issue.

Eventually we confirmed with Microsoft support that this issue is a bug and no hotfix is currently available.

In terms of workarounds, not many good ones exist. I tested adding a second Alternate Access Mapping pointing to the NetBios name, however this only works if all clients use the non-hostheader address, in other words:

Site: "Project XYZ Workspace" accessed via http://servername/site/projectxyz will work BUT when accessed via http://hostheader/site/projectxyz (which is the same site) it DOES NOT WORK. That obviously has major drawbacks.

In the end in my case our solution was to move the PWA site into the other web application.

I hope this helps someone out there.

Share and Enjoy !

Shares

Project / SharePoint 2010 Launch date announced!

The official date(s) has now been announced on the Office 2010 Engineering Blog:

In addition to the Office 2010 Technology Guarantee, were excited to confirm that Office 2010, SharePoint 2010, Visio 2010 and Project 2010 are on schedule and will release to manufacturing (RTM) next month.

For businesses, we will launch the 2010 set of products, including Office 2010, SharePoint 2010, Visio 2010, and Project 2010 worldwide on May 12. To find out more about the Worldwide Business Launch, visit http://sharepoint.microsoft.com/businessproductivity/proof/pages/2010-launch-events.aspx.

For consumers, Office 2010 will be available online and on retail shelves this June. Until then, you can get the Office 2010 beta at www.office.com/beta.”

Looks like May the 12th will be a big day this year, time to start getting ready!

Share and Enjoy !

Shares