Tips and Tricks for Building Visual Studio Workflows
Malin De Silva
SharePoint Specialist
Exilesoft, Sri LankaBusiness 365 Saturday - Singapore
24th October 2015
About Me
Planning, Development and administering experience since SharePoint 2007.
Speaker at many forums and conferences.
Blogger, StackExchange contributor and a big Azure fan.
Agenda
• Introduction to Workflows
• Creating Visual Studio Workflows
• Using REST API References
• Working with Tasks
• Challenges and Best Practices
Who are we?
• Developers?
• Have built Workflows? (Designer or Visual Studio)
• Have built Visual Studio Workflows in 2013?
2010 vs 2013 Workflows
SharePoint 2010 SharePoint 2013
Coupled to SharePoint servers Decoupled (Other consuming platforms)
Declarative or Custom Code Declarative
SharePoint Foundation and SharePoint Server
SharePoint Server
Content Types No
No Apps App Friendly
.Net framework used by SharePoint (.Net3.51)
.Net Framework xxx
Workflow runs inside SharePoint Workflows run outside SharePoint
Designer 2013 vs Visual Studio
SharePoint Designer 2013 Visual Studio
Power Users, SharePoint Developers SharePoint Developers
Can use Visio Can’t
Cannot debug Can debug, including SharePoint Online
No ALM support Full ALM support
Cannot be a part of apps Can be a part of apps
Workflow Development and Debugging Prerequisites
• SharePoint Farm
• Workflow Manager Farm connected
• Visual Studio 2012 or later
• Office Developer Tools for Visual Studio 2013
DEVELOPMENT
On-premises
• Allow Workflow Manager Tools to access through firewall
SharePoint Online
• May require installing a proxy client
• Create Azure Service Bus namespace
DEBUGGING
REST API References
• Any technology supports standard REST capabilities
• Mapping with client object model
• Client object model method:
List.GetByTitle(listname)
• REST endpoint:
http://server/site/_api/lists/getbytitle('listname')
Operation HTTP Method (s)
Read a resource GET
Create a resource POST
Update a resource PUT, MERGE
Delete a resource DELETE
REST API Examples
Operation HTTP Type Example
Read lists in a web GET http://malin.sharepoint.com/_api/lists
Creates a list POST http://malin.sharepoint.com/_api/lists
{'_metadata':{'type':SP.List},'AllowContentTypes': true,'BaseTemplate': 104,'ContentTypesEnabled':
true,'Description': 'My list
description','Title': 'RestTest'
Working with Workflow Tasks
• Content type changes
• Task Workflow Task (SharePoint 2013)
• Workflow Task content type has two new columns
• WorkfowInstanceId
• TaskOutcome
• Two types of tasks
• Single task
• Composite task
• Custom task forms
Custom Declarative Activities
• Richer market needs
• Repeatable design needs
• Develop and deploy to business market
• Use activities and actions
• .actions4 files
Workflow Best Practices
• Log as much as you can
• Scope workflow variables
• Ensure User when assigning tasks
• Design with failures in mind
Thank You!
Malin De Silva
SharePoint Specialist
Exilesoft
[email protected]/ [email protected]
@MalinD19