Site Management Workflow Activities - Sample Solution Now Available
Earlier this year, I published a series of blog posts on custom workflow activities for SharePoint 2013 and Office 365. Among other things, I covered how to build workflow activities to:
- Create sites.
- Set site permissions and list permissions.
- Create groups and set group owners.
- Break permissions inheritance.
- Set the associated owners, members and visitors groups on a site.
Since then, several people have asked me to make my source solution available - so here it is:
- It's proof-of-concept code, not production-ready code.
- For use as a learning aid in a test environment only.
- Please read the corresponding blog posts before you play around with the custom activities - they'll make much more sense once you've read the explanations.
To build and test the solution, you'll need a test environment with a local SharePoint 2013 installation, SharePoint Designer 2013, and Visual Studio 2012 with Office Developer Tools or Visual Studio 2013.
When you build the solution, Visual Studio creates a .wsp package. You can add this to the solutions gallery on any SharePoint site (including Office 365) - workflow activities in SharePoint 2013 are entirely declarative, so you don't have to worry about resource points and other restrictions. The solution deploys a site-scoped feature named Site Management Workflow Activities. Once you've activated this feature, the custom activities will be available when you open the site in SharePoint Designer.
Final note: To run these activities, your workflow service needs to be running with app permissions and it needs full control rights over the entire site collection (as you'd expect - you're asking it to create sites, create groups, set permissions, and so on). For guidance, see my first post in the series and the MSDN article Create a workflow with elevated permissions by using the SharePoint 2013 Workflow platform.