Following up on my previous blog post, Enable on-demand Project Site creation for your PMO, my second demo at InspireX was to show how you could a similar process to collect requests in a SharePoint Site and then create projects in Project Server automatically.
For the sake of this post, I will assume you have read through Alex's post, and treat this as an extension of that workflow.
Go ahead and add two columns to the SharePoint List, namely, Project Type. Make it a choice column.
You could add it to the form, and let the users pick this field, while creating a project request, or the approver could set it once he/she approves the request ( via Task Form).
Now, open up SQL Server Management Studio, run a couple of queries.
In my case the information was as below:
|EPT name||EPT GUID||Template GUID|
For the sake of brevity, I will assume you have set up the workflow, and also have a way of selecting the project type at approval or after approval. I will only cover the steps that require to be added to Alex Burton 's workflow.
After your Approval Action, add the "Set Variable" action,
to read the project type.
Now add a Switch action to do different
things based on different project type
For each branch on the Switch path, the following actions will
be the same, with different values
Call Web service to Create a project from Template.
Here you get to specify the template GUID you want to use.
The project will get created using this template GUID,
but will be created in the default EPT, which we will change later.
Call Web service to Publish the Project
We need to now change the Enterprise Project Type. So
Call Web service to Check-Out the project.
Now call a webservice, but note the change
in the ASMX and the web method. We are
calling the workflow.asmx webservice.
Here you get to set the EPT UID, to change the
project to your desired type.
And finally, check the project back in.
That's pretty much it. Now you can create projects in Project server, AND also have the projects to be of your desired type.
Now, this post assumes that the project site template is same for all project types. If the project site template is different for different project types, then you might need to defer the creation of the project site until after you create and change the project to your desired type.
Hope that helps!