Welcome to MSDN Blogs Sign in | Join | Help

How to use the “Skip to Stage” Feature in Project Server 2010 Workflows

Introduction

The skip to stage feature is designed to allow administrators the ability to restart a workflow and have it attempt to skip along the workflow until it reaches a particular stage. A common scenario for this functionality is when a project has progressed to a specific point in a workflow, but needs to be pushed back to a previous stage due to any number of reasons, such as, a new stage was inserted that needs to be addressed, certain fields need to be changed that are exposed only in previous stages, etc.

Project Server workflows, like SharePoint workflows, must always be executed linearly. They cannot begin execution at random locations within a workflow. Neither can they “jump” from one point to another point, unless coded to do so within the workflow. The skip to stage functionality cannot circumvent this limitation. As such, the issue with restarting a workflow and attempting to push it to a particular point is that any activities which “stopped” the workflow before will continue to do so again. For Example, activities such as SetProjectStage, OnProjectSubmit, OnProjectCommit, the officeTask, ect, will still cause the workflow to dehydrate and give control back to the user. Although for the SetProjectStage activity we have done some extra work and put logic inside it so that it can be skipped, so long as there are no required fields left in the stage

Therefore, to fully work with the skip to stage functionality you will need to wrap activities within “if statements”. When an administrator restarts a workflow and chooses to skip to a certain stage, we pass into the workflow two properties. The first property indicates that a skip stage command has been sent, and the second property contains the stage Guid that the workflow should stop at. Our SetProjectStage activity reads these two variables and skips if the first variable is set to true, and if the current stage is not the stage that is set in the second property. However, it won’t skip if there are required fields in the stage. So you will need to mimic this behavior around your other activities. You should wrap all of the activities between the SetProjectStage activities (not including the SetProjectStage activity) with an ifElseActivity statement that checks the first Property.

Customizing Workflows in Visual Studio to work with skip to stage

To make any workflow work correctly with the skip to stage functionality an “if statement” should be placed around all of the activities between each of the SetProjectStages. The key example of when this would be necessary is for the office task activities.

Screen shot of example workflow:

clip_image003

In the above example the “ifElseActivity1” is used to bypass the leadApproval sequence activity, which contains all of our approval activities.

As you can see from the above screen shot, it is the “if statement” that we need to figure out how to code. In order to do so, we need to be aware of the two properties that are passed into the workflow during a skip to stage event:

WorkflowContext.SkipToStage : Boolean : If true, a skip to stage functionality has been requested

WorkflowContext.StageUid : Guid : Guid of the stage the workflow should skip to

Steps for creating the workflow:

1. Insert and set the properties of a SetProjectStage activity

· You will need to set the “AlwaysWait” property to True in order for the Skip to Stage scenario to properly work.

· If you do not set the Always wait property to true the workflow may not be able to skip to and stop at previous stages.

clip_image004[9]

2. Insert an IfElseActivity

3. Have the activity check the “projectSequence1.WorkflowContext.SkipToStage” variable.

· If variable is set to false, execute all activities

· Else, bypass

clip_image006

clip_image007

The WorkflowContext.StageUid is not needed for the “If Statement” but is there in case you wish to check what stage the user is trying to skip to.

*The complete above example is found in the attached Visual Studio solution.*

Administration: Initiating the Skip to Stage feature

To attempt to force a project to skip to a particular stage, do the following within Project Server.

1. Log into Project Server as an Administrator

2. Go to Server Setting

clip_image008[4]

3. Click on “Change or Restart Workflows”

clip_image009[7]

4. In the top drop down, select the EPT that the project(s) that you would like to restart and skip to a stage belong to.

5. Select the project(s) which you would like restart and skip to stage from the left panel and add them to the right panel.

clip_image011

6. Check the “Restart current workflow for the selected projects” option

clip_image012[4]

a. Alternatively you can also select the “Associate projects with a new Enterprise Project Type:” option. If you select an Enterprise Project Type that has a workflow associated with it, you can then select which stage in that workflow the project(s) should attempt to skip to.

7. Next select which stage the project(s) should attempt to skip to

a. Skip until the current workflow stage

i. Selecting this option will tell the projects to attempt to skip until they reach the stage that the project(s) are in currently

b. Skip to a particular workflow stage & then selecting a particular stage

i. Selecting this option will tell the projects to attempt to skip until they reach the stage that has been selected

ii. If the selected stage does not exist, the workflow will stop at the very first opportunity.

8. Press OK

9. The project restart jobs will be sent to the queue, and the projects will attempt to restart and skip.

Skip to Stage Example

Expected behavior of the skip to stage can be summed up by the following example.

· A workflow has 3 stages

· All stages are marked as “AlwaysWait”

· Project is on Stage 2

· Stage 1’s required custom fields are filled out

· Stage 2’s required custom fields are not filled out

· Stage 3’s required custom fields are not filled out

Administrator will go and:

o Restart Skip to current stage

§ This will make the workflow restart and stop at stage 2

o Restart Skip to stage 1 (trying to make the workflow stop on a stage where all of the require custom fields are filled out)

§ This will make the workflow stop at stage 1 and wait for submit

o Restart Skip to stage 3 (trying to make it jump over stage 2 even though its required custom fields are not yet filled out)

§ Workflow will stop at stage 2

§ Workflow will not be able to skip stage2 if it has required fields.

§ If you really want to skip it, you need wrap the SetProjectStage as well in an if/else skip condition, which checks the SkipToStage variable and the StageUid variable.

o Restart Skip to stage 5 (trying to make the workflow stop on a stage that does not exist)

§ Workflow will stop at stage 1. This is because of the combination of “Destination stage” doesn’t exist & current stage=”Always wait”.

Conclusion

This feature has been designed and created to address the majority of our customer needs when it comes to being able to skip between stages. In this blog we reviewed there are two steps to use this feature. The first is to correctly develop your workflows to be able to skip over the activities that are between the SetProjectStage activities. This is done by wrapping the activities within an ifElse activity. And the second stage is to restart the workflows and select the stage the project should attempt to skip to. This is done with Project Server --> Server Settings --> Change or Restart Workflows.

If you have any additional questions please feel free to post comments, and I will follow up accordingly.

Posted by sachung | 0 Comments
Filed under:

Attachment(s): Skip to Stage Sample Workflow.zip

Sweeten your Project 2010 environment with Custom Fields

The Project 2010 SDK nicely documents Custom Field functionality – very important functionality for customizing Project 2010 - Custom Fields enable you to capture and calculate additional metadata for Projects, Resources, Tasks and Assignments. Project 2010 SDK: “You can filter, group, sort, and create OLAP cubes and reports based on custom field values. Project 2010 extends the functionality and ease of use of custom fields compared to previous versions of Project.” – lot of power and relatively easy to do! However – proper planning is strongly advised :)

Project 2010 SDK: Custom Fields in Project 2010 (http://msdn.microsoft.com/en-us/library/ee767683(office.14).aspx)

Many executives like graphical indicators – that simple graphically show the values in your Custom Fields (Visual Studio not required, all could be configured via PWA or Project Desktop User Interface, even when an advanced calculation formula is required) -

Using Formulas and Graphical Indicators with Custom Fields (http://msdn.microsoft.com/en-us/library/ee767700(office.14).aspx)

Using graphical indicators in Project

Posted by jkalis | 0 Comments

Get ready for the rich Business Intelligence platform in 2010

Just wanted to bring–up few links on the BI capabilities – that could be used in 2010 as well:

2010 Resources -

Posted by jkalis | 0 Comments

Update of Impersonation Article and Code for Project Server 2010

Because there have been several recent changes in the post-beta version of Project Server 2010 and Office SharePoint Server 2010, the SDK article How to: Use Impersonation with WCF is not correct for the 4730.1010 and later builds of Project Server. The attached Impersonation_PSIProxy.zip file includes the following:

  • Revised article: How to: Use Impersonation with WCF.docx
    • Changes required to use a Project Server installation that has multi-authentication (both Windows and Forms authentication)
    • Procedures for setting permissions for impersonation (requires permissions in both the SharePoint Service application and in Project Web App)
  • Complete Visual Studio 2008 solution (can be opened and converted with Visual Studio 2010)
  • Proxy files for the PSI services (build 4730.1010), including:
    • Scripts to update the proxy files on a Project Server computer and build a PSI proxy assembly
    • Intellisense files
    • Temporary web.config file and instructions, to use when updating the proxy files

 

Project 2010 Beta - Virtual Image

We have published the VM download on the following link yesterday

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8e709e2e-c9a1-4c7e-90d6-a52bcc8e5daf. So if you want to get started quickly – this is your option.

It’s optimal to run it on machine with 8GB RAM, Solid State Drive is advised for good performance. Windows Server 2008 R2 with Hyper-v is required.

Please pay close attention to the document “Setting up the Host Machine for the SharePoint 2010 Virtual Machines” included in the download. Not setting-up the network as advised will cause several services not starting and the PWA will not come up.

 

This image is based on the SharePoint 2010 Beta Base VM.

Posted by jkalis | 0 Comments

Project 2010 SDK - January update

The  pre-release Project 2010 SDK is updated on MSDN. Post-beta builds of Project Server are changed for setting ASMX and WCF service references and using multi-authentication (where Windows and Forms are both used) with Claims. These issues do not affect the Project Server 2010 beta release.

New topic:
How to: Use Impersonation with WCF  (see note at bottom for Claims)

Topics with major updates:
Project 2010 SDK Documentation (introductory page)
Using Formulas and Graphical Indicators with Custom Fields 

How to: Create a Branching Workflow 
How to: Install and Test a Project Server Workflow

Overview of WCF and the PSI 
Walkthrough: Developing PSI Applications Using WCF (see note at bottom for Claims)
Prerequisites for ASMX-Based Code Samples  (see note at bottom for Claims)
Prerequisites for WCF-Based Code Samples  (see note at bottom for Claims)

 

 

 

 

In Project 2010 PWA gets renamed to PWA. No kidding :)

Everyone – you may have seen this post from Heather.

In Project 2010 PWA stands for Project Web App - we change the name to maintain consistency with other Office 2010 Web Apps and to reflect the increasingly rich feature set included with PWA beyond simply accessing data.

Posted by jkalis | 0 Comments

Project 2010 Customization and Programming Forum just launched!

Project 2010 Customization and Programming

Discuss customizations and programming for Project Web Access 2010, Project Server 2010, Project Professional 2010 and Project Standard 2010. Includes User Interface (UI) customizations, Project Server Interface (PSI) and Visual Basic for Applications (VBA) Programming.

 

All available Project 2010 forums are here - http://social.msdn.microsoft.com/Forums/en-US/category/projectserver2010,projectprofessional2010/.

Posted by jkalis | 0 Comments

SharePoint 2010: Professional Developer Evaluation Guide and Walkthroughs

Hi everyone – in the Project 2010 blog posts, WebCasts, presentations and seminars we stress on how SharePoint is important for Project 2010 – not only for IT professionals, but especially for developers – YOU. This is a great resource that SharePoint has put together http://www.microsoft.com/downloads/details.aspx?FamilyID=cffb14e8-88a9-43bd-87aa-4792ab60d320&displaylang=en, if you have not seen yet, worth looking!

Posted by jkalis | 0 Comments

TechED Europe - Microsoft Project 2010 Overview PowerPoint Deck

We did two Project 2010 sessions at TechEd Europe – Christophe (thanks!) posted the decks on SkyDrive here as he mentioned here http://blogs.msdn.com/chrisfie/archive/2009/12/22/microsoft-project-2010-overview-powerpoint-deck.aspx

We have also shot two short videos on the 2010 news for Developers and  IT Professionals as mentioned here.

Happy holidays!

Posted by jkalis | 1 Comments

Just a reminder of a WebCast on Project 2010 that you cannot miss!!!

Chris Boyd, Program Manager, Microsoft - Project 2010 and Project Server 2010 Programmability (Level 200)

Posted by jkalis | 0 Comments

MSDN Upcoming WebCasts: Project 2010 Programmability & Real World Solutions

This week is full of Project Programmability content!

 

Stephen C. Sanderlin, System and Software Architect, MSProjectExperts - Real-World Solutions: Project Server Security in SQL Server Reporting Services (Level 300)

  • Where: http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032423645&EventCategory=4&culture=en-US&CountryCode=US
  • When: Wednesday, December 16, 2009 1:00 PM Pacific Time (US & Canada)
  • What: In this webcast, we discuss a method of taking advantage of Microsoft Office Project Server security in Microsoft SQL Server Reporting Services reports. We also cover a scenario where a customer has requested a SQL Server Reporting Services report that displays sensitive financial data. The customer only wants executors of the report to see information on projects to which they have access. Join us to learn more!

 

Chris Boyd, Program Manager, Microsoft - Project 2010 and Project Server 2010 Programmability (Level 200)

 

Both will be available as recording shortly (1-2 days) after the live run!

Posted by Chris Boyd | 0 Comments

New MSDN Article: Using Project Server Security in SQL Server Reporting Services (SSRS) Reports

Do you have a desire to secure the data from Reporting database based on user rights in the Project Server? You might be interested in this:

 

Big thanks to Stephen C. Sanderlin, MSProjectExperts, who wrote this article and extensive code sample. It’s an excerpt from his forthcoming book, Developer's Guide to Microsoft Project Server 2010.

 

High-level logic overview of ReportingPSISecurity

Posted by jkalis | 0 Comments

Project 2010 SDK

The Project 2010 SDK download and the MSDN online release are both published, and the Project Developer Center portal is updated.

What's New

Following are the major content sections in the Project 2010 SDK.

Articles online:

Note: Some JS Grid articles are currently in the Project SDK, but are updated in the SharePoint Foundation SDK. The basic articles will be removed from the Project SDK in the next update, and we will add Project-specific articles over time. See JS Grid Control and Microsoft.SharePoint.JSGrid Namespace for the JS Grid documentation.

Download:

For the first time, the Project SDK download is installed with an MSI, in [Program Files]\Microsoft SDKs – along with the SharePoint Foundation, SharePoint Server, and Windows SDK downloads.  The installation also creates entries on the Start menu:

clip_image001

Major content in the download:

  • pj14SDK_beta.chm is an HTML Help file that includes the same conceptual topics and managed code reference that is online.
  • pj14ReportingDB_beta.chm documents the RDB schema.
  • OLAPCubeSchemas2010.xlsx
  • mspdi_pj14.xsd is the Project Standard / Professional XML schema for data interchange.
  • WINPROJ.DEV.hxs is an update of VBA Help that includes the latest changes in the VBA OM documentation and (at last) F1 Help IDs that work right. There are also instructions for replacing the VBA Help file shipped with the Project beta.
  • Intellisense subdirectory: includes updates of the XML files for Intellisense descriptions, instructions for installing, and scripts for creating a PSI proxy assembly using either the WCF or ASMX interface. With a proxy assembly, developers can see Intellisense descriptions for the PSI Web service objects and members.
  • BranchingWorkflow includes the complete Visual Studio 2010 project for creating a Project Server workflow, as described in the online SDK.
  • WCFHelloProject includes a Visual Studio 2008 project that programmatically configures a WCF application for Project Server. It also includes a Visual Studio 2010 project that configures the WCF application using the app.config file, which enables many of the flexible features of WCF (for example, the same app can be configured to run over HTTP SOAP for the Extranet, or with NET.TCP for faster Intranet access – without recompiling).

--Jim

Posted by Chris Boyd | 0 Comments
Filed under: ,

Project 2010 Beta is OUT!

In case you are eager to get your hands on the Project 2010 Beta and dive into the SDK – http://msdn.microsoft.com/en-us/office/aa905469.aspx.

Project 2010 product information http://www.microsoft.com/project/2010/ including sessions from Project Conference!

Enjoy!

Posted by jkalis | 0 Comments
More Posts Next page »
 
Page view tracker