SlideShare a Scribd company logo
Workflow: A deep dive into developing workflows using Visual Studio and InfoPath Chris O’Brien – SharePoint MVP  http://www.sharepointnutsandbolts.com
Workflow intro Key decisions Can I use an SPD workflow instead of Visual Studio? Sequential vs. state machine workflows ASPX vs. InfoPath forms Visual Studio workflows in detail The 4 complexities of workflow Chris’s workflow bonanza pack!  7 key resources, 5 ‘how-to’ guides, 4 advanced tips, 3 pitfalls (+ slides, sample code) What we’ll cover
SharePoint workflows are  always  associated with content e.g: Document Form (typically InfoPath) List item Workflows revolve around tasks Person X must do Y Workflows can be started manually or automatically (i.e. when new item is added) Introduction
Introduction Different workflow types: VS workflows require coding ability (and ideally InfoPath knowledge) SPD workflows can be powerful, but limitations Standard workflows simple to use Standard SPD VS COMPLEXITY
Advantages of SPD workflows: Built using wizard, not code Powerful - wide-range of activities to add Simple to deploy  Limitations of SPD workflows: Can only be applied to one list at a time (no re-use) Custom code activities, but not ad-hoc custom code Not flexible enough for many requirements Key decision #1 – Visual Studio or SPD?
Sequential workflow: ‘ Traditional’ design Generally flow downwards, but: If/else activity While loop activity (cannot overlap) These aside, cannot go ‘back up’  Key decision #2 – VS workflow type
State machine workflow: Series of ‘states’ e.g: ‘ Awaiting initial review’ ‘ Awaiting final review’ ‘ Completed’ Can go from any state to any state Developer specifies ‘transitions’ between states  Key decision #2 – VS workflow type
InfoPath or custom .aspx forms? Factors: InfoPath forms quicker to develop Much less complexity with InfoPath forms Custom forms must interface with workflow API manually InfoPath forms integrate with Word, Excel etc. However, InfoPath unlikely to be suitable for public website See ‘collect feedback’ sample in MOSS SDK for custom .aspx forms example Key decision #3 – forms
Item for workflow: expenses form (InfoPath) Process: User submits expense claim Approved by department Approved by finance -> Completed Development process: ‘ ASPX-like’ model Coding Drag activity from toolbox Write code to tell it what to do/what values to use Deploy/test My example – Acme Inc.
Acme expense workflow – first steps demo
We just hit them: #1: Using activities  – two ways to set properties: Using code Properties window often used to  bind  property to a member variable (e.g. our string CurrentLogAction) #2: Deployment MS help us here – PostBuildActions.bat We provide config in Feature files Need to associate workflow with list(s) after each  full  deployment Complexities #1 and #2
How do I get at the information which was entered into the form? Can write code to parse XML e.g. XmlDocument Can use serialization (preferred): Obtain schema (.xsd) for your form Use xsd.exe to generate class Add class to project Add deserialization code to workflow Complexity #3
How do I work with SharePoint tasks? CreateTask Set properties in code  Set TaskType to 0, 1, 2 etc. to associate task edit form  If required, pass values to task form via ExtendedProperties OnTaskChanged In state machine should be in EventDriven activity Collect values from form Copy to field-level vars if another activity needs to use value (e.g. IfElse) CompleteTask No code required, just set CorrelationToken & TaskID Complexity #4
Always always design in Visio first! Error/bug? Check the SharePoint logs first Learn how to debug workflows - See ‘how-to’ in my starter pack document Always rename activities so the ID makes sense Write to SharePoint logs for simpler diagnostics when live - Article on my blog coming soon Top 5 workflow tips See my starter pack for advanced tips!
SharePoint has different levels of workflow Key decisions summary: OOTB/SPD workflow may be sufficient Prefer state machine over sequential workflow InfoPath forms simpler than custom ASPX Demo - first stage of an expense claim workflow Being armed with right resources is key! What was he talking about??
Downloadable resources:  http://www.sharepointnutsandbolts.com/2008/01/resources-from-my-workflow-deep-dive.html Blog:  www.sharepointnutsandbolts.com LinkedIn:  http://www.linkedin.com/in/chrisobrienmvp   Thank you Q & A
Ad

More Related Content

What's hot (8)

Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and SwaggerIntroduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Agusto Sipahutar
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien
 
Latest-Resume10312016
Latest-Resume10312016Latest-Resume10312016
Latest-Resume10312016
Rama Muthukrishnan Thanaraj
 
Angular JS training institute in Jaipur
           Angular JS training institute in Jaipur           Angular JS training institute in Jaipur
Angular JS training institute in Jaipur
HEMANT SAXENA
 
What's new for Developers in Visual Studio 2013
What's new for Developers in Visual Studio 2013What's new for Developers in Visual Studio 2013
What's new for Developers in Visual Studio 2013
Microsoft Visual Studio
 
Mule Integration with Atlassian JIRA
Mule Integration with Atlassian JIRAMule Integration with Atlassian JIRA
Mule Integration with Atlassian JIRA
Ramakrishna Narkedamilli
 
Apps thatworkandflow
Apps thatworkandflowApps thatworkandflow
Apps thatworkandflow
Koen Handekyn
 
Chapter1 introduction to asp.net
Chapter1  introduction to asp.netChapter1  introduction to asp.net
Chapter1 introduction to asp.net
mentorrbuddy
 
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and SwaggerIntroduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Agusto Sipahutar
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien
 
Angular JS training institute in Jaipur
           Angular JS training institute in Jaipur           Angular JS training institute in Jaipur
Angular JS training institute in Jaipur
HEMANT SAXENA
 
What's new for Developers in Visual Studio 2013
What's new for Developers in Visual Studio 2013What's new for Developers in Visual Studio 2013
What's new for Developers in Visual Studio 2013
Microsoft Visual Studio
 
Apps thatworkandflow
Apps thatworkandflowApps thatworkandflow
Apps thatworkandflow
Koen Handekyn
 
Chapter1 introduction to asp.net
Chapter1  introduction to asp.netChapter1  introduction to asp.net
Chapter1 introduction to asp.net
mentorrbuddy
 

Similar to SharePoint workflow deep-dive (20)

...and thus your forms automagically disappeared
...and thus your forms automagically disappeared...and thus your forms automagically disappeared
...and thus your forms automagically disappeared
Luc Bors
 
Intro to Application Express
Intro to Application ExpressIntro to Application Express
Intro to Application Express
José Angel Ibarra Espinosa
 
SharePoint Framework at a glance
SharePoint Framework at a glanceSharePoint Framework at a glance
SharePoint Framework at a glance
Haaron Gonzalez
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
Dave Bost
 
MS flow.docx
MS flow.docxMS flow.docx
MS flow.docx
Sharepoint Designs
 
Building Workflow Applications Through the Web
Building Workflow Applications Through the WebBuilding Workflow Applications Through the Web
Building Workflow Applications Through the Web
T. Kim Nguyen
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
hamzadamani7
 
2007 SAPTech Ed
2007 SAPTech Ed2007 SAPTech Ed
2007 SAPTech Ed
Michelle Crapo
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 
Taking Your FDM Application to the Next Level with Advanced Scripting
Taking Your FDM Application to the Next Level with Advanced ScriptingTaking Your FDM Application to the Next Level with Advanced Scripting
Taking Your FDM Application to the Next Level with Advanced Scripting
Alithya
 
Cetas - Application Development Services
Cetas - Application Development ServicesCetas - Application Development Services
Cetas - Application Development Services
Kabilan D
 
Workflow Management with Espresso Workflow
Workflow Management with Espresso WorkflowWorkflow Management with Espresso Workflow
Workflow Management with Espresso Workflow
Rolf Kremer
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan
 
2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps
Gilles Pommier
 
SPUnite17 Become a Developer Hero by Building Office Add ins
SPUnite17 Become a Developer Hero by Building Office Add insSPUnite17 Become a Developer Hero by Building Office Add ins
SPUnite17 Become a Developer Hero by Building Office Add ins
NCCOMMS
 
Automating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesAutomating Workflows for Analytics Pipelines
Automating Workflows for Analytics Pipelines
Sadayuki Furuhashi
 
SharePoint 2010 Development
SharePoint 2010 DevelopmentSharePoint 2010 Development
SharePoint 2010 Development
Elaine Van Bergen
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010
Abram John Limpin
 
Automation and machine learning in the enterprise
Automation and machine learning in the enterpriseAutomation and machine learning in the enterprise
Automation and machine learning in the enterprise
alphydan
 
...and thus your forms automagically disappeared
...and thus your forms automagically disappeared...and thus your forms automagically disappeared
...and thus your forms automagically disappeared
Luc Bors
 
SharePoint Framework at a glance
SharePoint Framework at a glanceSharePoint Framework at a glance
SharePoint Framework at a glance
Haaron Gonzalez
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
Dave Bost
 
Building Workflow Applications Through the Web
Building Workflow Applications Through the WebBuilding Workflow Applications Through the Web
Building Workflow Applications Through the Web
T. Kim Nguyen
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
hamzadamani7
 
Getting Started with Zend Framework
Getting Started with Zend FrameworkGetting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 
Taking Your FDM Application to the Next Level with Advanced Scripting
Taking Your FDM Application to the Next Level with Advanced ScriptingTaking Your FDM Application to the Next Level with Advanced Scripting
Taking Your FDM Application to the Next Level with Advanced Scripting
Alithya
 
Cetas - Application Development Services
Cetas - Application Development ServicesCetas - Application Development Services
Cetas - Application Development Services
Kabilan D
 
Workflow Management with Espresso Workflow
Workflow Management with Espresso WorkflowWorkflow Management with Espresso Workflow
Workflow Management with Espresso Workflow
Rolf Kremer
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan
 
2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps
Gilles Pommier
 
SPUnite17 Become a Developer Hero by Building Office Add ins
SPUnite17 Become a Developer Hero by Building Office Add insSPUnite17 Become a Developer Hero by Building Office Add ins
SPUnite17 Become a Developer Hero by Building Office Add ins
NCCOMMS
 
Automating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesAutomating Workflows for Analytics Pipelines
Automating Workflows for Analytics Pipelines
Sadayuki Furuhashi
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010
Abram John Limpin
 
Automation and machine learning in the enterprise
Automation and machine learning in the enterpriseAutomation and machine learning in the enterprise
Automation and machine learning in the enterprise
alphydan
 
Ad

More from Chris O'Brien (20)

Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutionsChris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien
 
Chris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing workChris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing work
Chris O'Brien
 
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien
 
COB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline supportCOB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline support
Chris O'Brien
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
Chris O'Brien
 
COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018
Chris O'Brien
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris O'Brien
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien
 
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien
 
Application Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 developmentApplication Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 development
Chris O'Brien
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 development
Chris O'Brien
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien
 
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrienDeep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Chris O'Brien
 
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrienCustomizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Chris O'Brien
 
SP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'BrienSP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'Brien
Chris O'Brien
 
Getting to grips with SharePoint 2013 apps - Chris O'Brien
Getting to grips with SharePoint 2013 apps - Chris O'BrienGetting to grips with SharePoint 2013 apps - Chris O'Brien
Getting to grips with SharePoint 2013 apps - Chris O'Brien
Chris O'Brien
 
SharePoint Ribbon Deep Dive
SharePoint Ribbon Deep DiveSharePoint Ribbon Deep Dive
SharePoint Ribbon Deep Dive
Chris O'Brien
 
Automated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 DevelopmentAutomated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 Development
Chris O'Brien
 
Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutionsChris O'Brien - Building AI into Power Platform solutions
Chris O'Brien - Building AI into Power Platform solutions
Chris O'Brien
 
Chris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing workChris OBrien - Azure DevOps for managing work
Chris OBrien - Azure DevOps for managing work
Chris O'Brien
 
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmapsChris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien - Ignite 2019 announcements and selected roadmaps
Chris O'Brien
 
COB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline supportCOB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline support
Chris O'Brien
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
Chris O'Brien
 
COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018
Chris O'Brien
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris O'Brien
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien
 
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien - Intro to Power BI for Office 365 devs (March 2017)
Chris O'Brien
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien
 
Application Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 developmentApplication Lifecycle Management for Office 365 development
Application Lifecycle Management for Office 365 development
Chris O'Brien
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 development
Chris O'Brien
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien
 
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrienDeep dive into SharePoint 2013 hosted apps - Chris OBrien
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Chris O'Brien
 
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrienCustomizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Chris O'Brien
 
SP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'BrienSP2013 for Developers - Chris O'Brien
SP2013 for Developers - Chris O'Brien
Chris O'Brien
 
Getting to grips with SharePoint 2013 apps - Chris O'Brien
Getting to grips with SharePoint 2013 apps - Chris O'BrienGetting to grips with SharePoint 2013 apps - Chris O'Brien
Getting to grips with SharePoint 2013 apps - Chris O'Brien
Chris O'Brien
 
SharePoint Ribbon Deep Dive
SharePoint Ribbon Deep DiveSharePoint Ribbon Deep Dive
SharePoint Ribbon Deep Dive
Chris O'Brien
 
Automated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 DevelopmentAutomated Builds And UI Testing in SharePoint 2010 Development
Automated Builds And UI Testing in SharePoint 2010 Development
Chris O'Brien
 
Ad

SharePoint workflow deep-dive

  • 1. Workflow: A deep dive into developing workflows using Visual Studio and InfoPath Chris O’Brien – SharePoint MVP http://www.sharepointnutsandbolts.com
  • 2. Workflow intro Key decisions Can I use an SPD workflow instead of Visual Studio? Sequential vs. state machine workflows ASPX vs. InfoPath forms Visual Studio workflows in detail The 4 complexities of workflow Chris’s workflow bonanza pack! 7 key resources, 5 ‘how-to’ guides, 4 advanced tips, 3 pitfalls (+ slides, sample code) What we’ll cover
  • 3. SharePoint workflows are always associated with content e.g: Document Form (typically InfoPath) List item Workflows revolve around tasks Person X must do Y Workflows can be started manually or automatically (i.e. when new item is added) Introduction
  • 4. Introduction Different workflow types: VS workflows require coding ability (and ideally InfoPath knowledge) SPD workflows can be powerful, but limitations Standard workflows simple to use Standard SPD VS COMPLEXITY
  • 5. Advantages of SPD workflows: Built using wizard, not code Powerful - wide-range of activities to add Simple to deploy Limitations of SPD workflows: Can only be applied to one list at a time (no re-use) Custom code activities, but not ad-hoc custom code Not flexible enough for many requirements Key decision #1 – Visual Studio or SPD?
  • 6. Sequential workflow: ‘ Traditional’ design Generally flow downwards, but: If/else activity While loop activity (cannot overlap) These aside, cannot go ‘back up’ Key decision #2 – VS workflow type
  • 7. State machine workflow: Series of ‘states’ e.g: ‘ Awaiting initial review’ ‘ Awaiting final review’ ‘ Completed’ Can go from any state to any state Developer specifies ‘transitions’ between states Key decision #2 – VS workflow type
  • 8. InfoPath or custom .aspx forms? Factors: InfoPath forms quicker to develop Much less complexity with InfoPath forms Custom forms must interface with workflow API manually InfoPath forms integrate with Word, Excel etc. However, InfoPath unlikely to be suitable for public website See ‘collect feedback’ sample in MOSS SDK for custom .aspx forms example Key decision #3 – forms
  • 9. Item for workflow: expenses form (InfoPath) Process: User submits expense claim Approved by department Approved by finance -> Completed Development process: ‘ ASPX-like’ model Coding Drag activity from toolbox Write code to tell it what to do/what values to use Deploy/test My example – Acme Inc.
  • 10. Acme expense workflow – first steps demo
  • 11. We just hit them: #1: Using activities – two ways to set properties: Using code Properties window often used to bind property to a member variable (e.g. our string CurrentLogAction) #2: Deployment MS help us here – PostBuildActions.bat We provide config in Feature files Need to associate workflow with list(s) after each full deployment Complexities #1 and #2
  • 12. How do I get at the information which was entered into the form? Can write code to parse XML e.g. XmlDocument Can use serialization (preferred): Obtain schema (.xsd) for your form Use xsd.exe to generate class Add class to project Add deserialization code to workflow Complexity #3
  • 13. How do I work with SharePoint tasks? CreateTask Set properties in code Set TaskType to 0, 1, 2 etc. to associate task edit form If required, pass values to task form via ExtendedProperties OnTaskChanged In state machine should be in EventDriven activity Collect values from form Copy to field-level vars if another activity needs to use value (e.g. IfElse) CompleteTask No code required, just set CorrelationToken & TaskID Complexity #4
  • 14. Always always design in Visio first! Error/bug? Check the SharePoint logs first Learn how to debug workflows - See ‘how-to’ in my starter pack document Always rename activities so the ID makes sense Write to SharePoint logs for simpler diagnostics when live - Article on my blog coming soon Top 5 workflow tips See my starter pack for advanced tips!
  • 15. SharePoint has different levels of workflow Key decisions summary: OOTB/SPD workflow may be sufficient Prefer state machine over sequential workflow InfoPath forms simpler than custom ASPX Demo - first stage of an expense claim workflow Being armed with right resources is key! What was he talking about??
  • 16. Downloadable resources: http://www.sharepointnutsandbolts.com/2008/01/resources-from-my-workflow-deep-dive.html Blog: www.sharepointnutsandbolts.com LinkedIn: http://www.linkedin.com/in/chrisobrienmvp Thank you Q & A

Editor's Notes

  • #2: Show of hands for who has done workflow development/which kind