Filter based on Worklow state
-
Thursday, May 03, 2012 11:15 AM
Hi,
I have couple of custom workflows developed in my project server 2010 environment. Created a view containing workflow related information like stage, phase, workflow state etc. but unfortunatly(and very irritatingly) I cannot filter the view based upon column 'Workflow State'. To get a list of projects which are pending approval, I have had to create a basic SSRS report. Had that filter been available, it could have been done using the views of PS 2010 itself.
Regards,
Atul
All Replies
-
Thursday, May 03, 2012 11:30 AM
Hi Atul,
If I understand correctly, You are looking for a report which shows the Workflow info phase, stages & Workflow states (The enumerated field values are Not Started, Waiting For Input, Waiting For Approval, Workflow Processing, Completed, Completed With Errors, and Workflow Completed)
http://office.microsoft.com/en-us/project-server-help/workflow-state-project-field-HA010371128.aspx
Did you try with SQL query, You may try to see if that helps.SELECT P.ProjectUID , P.ProjectName , WP.PhaseName , WS.StageName , WSI.StageOrder , EPT.EnterpriseProjectTypeName , WSI.StageEntryDate , WSI.StageStatus , CASE WHEN WSI.StageStatus = 0 THEN 'Not Started' WHEN WSI.StageStatus = 1 THEN 'Waiting for Input' WHEN WSI.StageStatus = 2 THEN 'Waiting for Approval' WHEN WSI.StageStatus = 3 THEN 'Workflow Processing' WHEN WSI.StageStatus = 4 THEN 'Stage Completed' WHEN WSI.StageStatus = 5 THEN 'Completed with Errors' WHEN WSI.StageStatus = 6 THEN 'Workflow Completed' END AS [Stage Status Description] FROM MSP_EpmWorkflowStage AS WS INNER JOIN MSP_EpmWorkflowPhase AS WP ON WS.PhaseUID = WP.PhaseUID INNER JOIN MSP_EpmWorkflowStatusInformation AS WSI ON WS.StageUID = WSI.StageUID INNER JOIN dbo.MSP_EpmProject AS P ON WSI.ProjectUID = P.ProjectUID INNER JOIN dbo.MSP_EpmEnterpriseProjectType AS EPT ON P.EnterpriseProjectTypeUID = EPT.EnterpriseProjectTypeUID WHERE WSI.StageEntryDate IS NOT NULL AND (WSI.StageStatus != 0 AND WSI.StageStatus != 4) ORDER BY P.ProjectName
Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
- Edited by Amit Khare - Project Management Consultant Thursday, May 03, 2012 11:33 AM
-
Thursday, May 03, 2012 12:15 PM
Hello Amit,
I have already made the report with somewhat similiar approach given by you. My query was actually not a question, just a personal view that maybe having Workflow State available in filter section of views in PWA, the query would not be needed at all!
Thanks for response neverthless.
Regards,
Atul
-
Thursday, May 03, 2012 12:44 PM
Sorry to misinterpret your view. Good that you have already done the similar stuff.
Agreed with your view , Workflow state is not directly available in PWA project views filtering option that's why We chose path of SSRS. I would say that having this field could save some of our time. :)Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
-
Friday, May 04, 2012 8:41 AMModerator
Hello Atul
Reason is Workflow state field is of an "project server custom" enumerated field type, which means it is pulling value from a list which is predefined, hence acts as look up table, and there are restrictions on using lookup table in views such as, lookup table as filters support only tests "equal" and "does not equal" and so for being an enumerated type its not supported in filters
now there are alternatives like having a project level custom field of type text and setting its value from within workflow or using server side event handlers, now based on this new field it can be used for filtering values, but SSRS would be the easiest solution to implement
Hope this helps in understanding
Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com
-
Friday, May 04, 2012 10:51 AM
Thanks Amit & Sunil for sharing your views.
Sunil, the alternative that you suggested, having a project level custom field of type text and setting its value from within workflow, available OOB or some customization is needed? As per my knowledge, I believe some development effort will be needed here. For e.g, If I have to insert the current phase of a project into a project level custom field, how could that be possible?
Regards,
Atul
-
Friday, May 04, 2012 11:49 AMWhen you are working with customized workflow . You will need to update the Project level field (either a text or a lookup value corresponding to workflow state ) using the PSI - project web service. There are lot of samples available in SDK as well as in project blogs.
http://blogs.msdn.com/b/brismith/archive/2010/10/05/project-server-updating-and-deleting-custom-fields-using-the-psi.aspxThanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
-
Friday, May 04, 2012 1:45 PMModerator
So Atul since you already said you have already have many custom workflow developed, hence didnt elaborated, its kind of customization which is required but if you already have a workflow, then you can simply use "updateprojectproperty activity" within workflow to set any custom field values from within the workflow, but should be simple enough if workflow is already custom developed
Hence not OOB
Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com
- Edited by Sunil Kumar SinghMVP, Moderator Friday, May 04, 2012 1:45 PM
- Marked As Answer by Atul Sharma VTSP MS Thursday, May 24, 2012 5:32 AM

