SlideShare a Scribd company logo
1 of 31
Advanced SharePoint 2013 Workflow for
Developers
PAOLO PIALORSI, PIASYS
PAOLO@PIALORSI.COM

SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013
ZAGREB, NOVEMBER 27-28 2013
sponsors
Something about me
• Consultant, project manager and trainer
• More than 40 Microsoft certification exams passed
• Microsoft Certified Solution Master – Charter SharePoint

• Focused on SharePoint since the beginning
• Author of 10 books about XML, SOAP, .NET, LINQ
and SharePoint
•
•
•

Microsoft SharePoint 2010 Developer Reference, Microsoft Press
Microsoft SharePoint 2013 Developer Reference, Microsoft Press
Build Windows 8 Apps with Microsoft Visual C# and
Visual Basic Step by Step, Microsoft Press

• Speaker at main IT conferences
Agenda
• SharePoint 2013 and Workflow Manager (quick recall)
• Advanced workflows with SharePoint Designer 2013
• Custom actions and activities with Visual Studio 2013
• Workflow Security
• Workflow Forms
SHAREPOINT 2013 AND WORKFLOW
MANAGER
SharePoint 2013 and Workflow Manager
Access Control

SharePoint 2013
Content

People

Sharing

2010 WF

OAuth

_API (REST OM)

Workflow
Manager

Workflow Services Manager
Instances
Deployment

Interop
Messaging

WF Service Application Proxy

Workflow Client

SharePoint Designer

Visual Studio

Events

Service Bus
ADVANCED WORKFLOW WITH
SPD2013
Native Actions/Conditions are not enough …
But something is missing …
• Move File
• Upload File
• Search
• Publish/Approve Document
• Save data on a backend database
• Etc.
BUT WE HAVE
REST APIS
• Support XML/OData/JSON format
• Can be used to query (OData)
contents
• Can be used to manage
(add, update, delete) content
• Make the Client Side Object
Model (CSOM) remotely available
via REST
• Useful for JavaScript/jQuery
consumers
• But also for workflows in
SPD2013 or Visual Studio
2012/2013

_api is new alias for _vti_bin/client.svc
Server
Client

REST
OData
JSON

CSOM
JavaScript
Library

Silverlight
Library

Custom Client Code

.Net CLR
Library
_api Reference
Web Application Hostname

API Namespace

http(s)://{Host Name}/{site}/_api/{namespace}/

{object}
{property}
{indexer(index)}
{method({parameter},{parameter},…)}

Site Collection (Optional)
Operation
Sample URLs
• _api/web/lists
• _api/web/lists/getByTitle(‘Documents')
• _api/web/Lists/getByTitle('Documents')/Items
• _api/web/Lists/getByTitle('Documents')/Items(4)
• _api/web/CurrentUser
• _api/web/SiteUsers
• _api/web/getAvailableWebTemplates(lcid=1033)
• _api/web/RoleAssignments/GetPrincipalId(1)/Member
USING REST API FROM WORKFLOWS IN
SPD2013
CUSTOM ACTIONS AND ACTIVITIES WITH
VISUAL STUDIO 2013
Custom Activities vs Custom Actions
Custom Activity

Custom Action

• Custom element from Visual
Studio perspective
• Minimal functional element of a
workflow definition

• Custom element from SPD2013
perspective
• Wraps an activity or an
aggregation of activities
• Can be an Action or a Condition
• Reusable in SharePoint Designer
• Deployable through Sandboxed
Solutions
• Supported in Office 365!

• Defined one time, reusable many
times

• Come in two flavors
• Declarative: XAML
• Code based: .NET Type

• Reusable in Visual Studio and in
SharePoint Designer
• Complex deployment
• Not available in Office 365!
We can create libraries of custom actions
• Reusable in multiple workflow definitions
• Reusable in multiple site collections
• Maintainable (are based on WSP, and WSP are upgradable …)
• Some «common» examples
•
•
•
•

Create New List/Library
Delete List/Library
Publish a document «Pending» approval
Invoke remote HTTP services (REST/JSON/OData)
CREATING A CUSTOM ACTION FOR SPD2013 IN
VS2013
(PART 1)
Creating a Custom Action (recap)
• Create a Sandboxed Solution
• Add a «Workflow Custom Activity»
• Design the markup-based activity
• You can’t use code

• Define the .actions4 file
• It will be registered in the target site collection

• Package and deploy the WSP
• Close SPD2013 and clear cache
• C:Users{UserName}AppDataLocalMicrosoftWebsiteCache{site}

• Restart SPD2013 and use the custom action
Creating a Custom Activity (reference
only) a Workflow «Activity Library» project
• Create
• Add a class and inherit from the proper base Activity type
• CodeActivity, CodeActivity<T>
• AsyncCodeActivity, AsyncCodeActivity<T>
• NativeActivity, NativeActivity<T>

• Implement .NET code
• Create an .actions4 file
• It will be placed in TEMPLATE{LCID}Workflow folder

• Add the assembly to the Global Assembly Cache (GAC)
• Create an AllowedTypes.xml file
• %ProgramFiles%Workflow Manager1.0WorkflowArtifacts
• %ProgramFiles%Workflow Manager1.0WorkflowWFWebRootbin

• IISRESET + Restart «Workflow Manager Backend» service
• Close SPD2013, clear cache, restart SPD2013 and use the activity
WORKFLOW SECURITY
A Workflow is like an App
• The workflow engine has an App Principal
• You can manage app principals:
• https://{hostname}/sites/{site}/_layouts/15/appprincipals.aspx?Scope=Web
• https://{hostname}/sites/{site}/_layouts/15/appinv.aspx
• https://{hostname}/sites/{site}/_layouts/15/appregnew.aspx
Default permission model
• By default a workflow has write only permissions
• And while working leverages both
• User permissions
• Workflow App permissions

User
Permissions

App
Permissions

Workflow
Permissions
CREATING A CUSTOM ACTION FOR SPD2013 IN
VS2013
(PART 2)
App Step and AppOnlySequence (recap)
• You can configure a web site to «Allow workflows to use app
permissions»

• Assign «Full Control» to the workflow App Principal
(appinv.aspx)

<AppPermissionRequests>
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
</AppPermissionRequests>

• And Trust it!
WORKFLOW FORMS
Understanding Workflow Forms
• Every workflow definition can have
• Association Form: to associate a workflow definition to a target (0 or 1)
• Initiation Form: to start a workflow instance on a target (0 or 1)
• Task Forms: to provide custom UI for tasks (0 or more)

• Are common ASPX pages
• Visual Studio 2012/2013 provides item templates for
• Association and Initiation

• You need to manually define task forms
• Leveraging custom Workflow Task content types and custom task lists
Workflow Forms and Kind of Projects
• In Full Trust workflow projects
• Can run server-side code (SharePoint Server Object Model)
• Can do averything (they are full-trust)
• Are not support for cloud-based (Office 365) deployments

• In App for SharePoint projects
• Workflows are available in app-web only
• In a SharePoint-hosted app-web you can run only JavaScript code (!)
• The form templates provided by Visual Studio are JavaScript based

• You will have to interact with the Workflow Services Manager
Workflow Services Manager

Workflow Services Manager
Deployment
Service

Instance
Service

Subscription
Service

Messaging
Service

Interop
Service
CREATING CUSTOM WORKFLOW FORMS
questions?
HTTP://WWW.SHAREPOINTREFERENCE.COM/BLOG/

@PAOLOPIA
thank you.
SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013
ZAGREB, NOVEMBER 27-28 2013

More Related Content

More from SPC Adriatics

Securing Intellectual Property using Azure Rights Management Services
Securing Intellectual Property using Azure Rights Management ServicesSecuring Intellectual Property using Azure Rights Management Services
Securing Intellectual Property using Azure Rights Management ServicesSPC Adriatics
 
Creating Workflows in Project Online
Creating Workflows in Project OnlineCreating Workflows in Project Online
Creating Workflows in Project OnlineSPC Adriatics
 
Faster than a flash behind the scenes of patching SharePoint Online
Faster than a flash   behind the scenes of patching SharePoint OnlineFaster than a flash   behind the scenes of patching SharePoint Online
Faster than a flash behind the scenes of patching SharePoint OnlineSPC Adriatics
 
Role based views in Project and Resource Center
Role based views in Project and Resource CenterRole based views in Project and Resource Center
Role based views in Project and Resource CenterSPC Adriatics
 
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)SPC Adriatics
 
SharePoint Governance and Compliance
SharePoint Governance and ComplianceSharePoint Governance and Compliance
SharePoint Governance and ComplianceSPC Adriatics
 
From analyses to successful Implementation
From analyses to successful ImplementationFrom analyses to successful Implementation
From analyses to successful ImplementationSPC Adriatics
 
The key to a successful Office 365 implementation is adoption
The key to a successful Office 365 implementation is adoptionThe key to a successful Office 365 implementation is adoption
The key to a successful Office 365 implementation is adoptionSPC Adriatics
 
10 Steps to be Successful with Enterprise Search
10 Steps to be Successful with Enterprise Search10 Steps to be Successful with Enterprise Search
10 Steps to be Successful with Enterprise SearchSPC Adriatics
 
How the Cloud Changes Business Solution Design and Delivery
How the Cloud Changes Business Solution Design and DeliveryHow the Cloud Changes Business Solution Design and Delivery
How the Cloud Changes Business Solution Design and DeliverySPC Adriatics
 
Scaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other ToolsScaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other ToolsSPC Adriatics
 
SharePoint 2013 Search Operations
SharePoint 2013 Search OperationsSharePoint 2013 Search Operations
SharePoint 2013 Search OperationsSPC Adriatics
 
Office Online Server 2016 - a must for on-premises installation for SharePoin...
Office Online Server 2016 - a must for on-premises installation for SharePoin...Office Online Server 2016 - a must for on-premises installation for SharePoin...
Office Online Server 2016 - a must for on-premises installation for SharePoin...SPC Adriatics
 
Custom Code-The Missing Piece of the SharePoint Governance Puzzle
Custom Code-The Missing Piece of the SharePoint Governance PuzzleCustom Code-The Missing Piece of the SharePoint Governance Puzzle
Custom Code-The Missing Piece of the SharePoint Governance PuzzleSPC Adriatics
 
SharePoint 2016 Hybrid Sites Inside Out
SharePoint 2016 Hybrid Sites Inside OutSharePoint 2016 Hybrid Sites Inside Out
SharePoint 2016 Hybrid Sites Inside OutSPC Adriatics
 
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?SPC Adriatics
 
What's New for the BI workload in SharePoint 2016 and SQL Server 2016
What's New for the BI workload in SharePoint 2016 and SQL Server 2016What's New for the BI workload in SharePoint 2016 and SQL Server 2016
What's New for the BI workload in SharePoint 2016 and SQL Server 2016SPC Adriatics
 
Creating a Great User Experience in SharePoint
Creating a Great User Experience in SharePointCreating a Great User Experience in SharePoint
Creating a Great User Experience in SharePointSPC Adriatics
 
Introduction to AngularJS with the Microsoft Graph
Introduction to AngularJS with the Microsoft GraphIntroduction to AngularJS with the Microsoft Graph
Introduction to AngularJS with the Microsoft GraphSPC Adriatics
 

More from SPC Adriatics (20)

Securing Intellectual Property using Azure Rights Management Services
Securing Intellectual Property using Azure Rights Management ServicesSecuring Intellectual Property using Azure Rights Management Services
Securing Intellectual Property using Azure Rights Management Services
 
Creating Workflows in Project Online
Creating Workflows in Project OnlineCreating Workflows in Project Online
Creating Workflows in Project Online
 
Faster than a flash behind the scenes of patching SharePoint Online
Faster than a flash   behind the scenes of patching SharePoint OnlineFaster than a flash   behind the scenes of patching SharePoint Online
Faster than a flash behind the scenes of patching SharePoint Online
 
Role based views in Project and Resource Center
Role based views in Project and Resource CenterRole based views in Project and Resource Center
Role based views in Project and Resource Center
 
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
 
SharePoint Governance and Compliance
SharePoint Governance and ComplianceSharePoint Governance and Compliance
SharePoint Governance and Compliance
 
From analyses to successful Implementation
From analyses to successful ImplementationFrom analyses to successful Implementation
From analyses to successful Implementation
 
The key to a successful Office 365 implementation is adoption
The key to a successful Office 365 implementation is adoptionThe key to a successful Office 365 implementation is adoption
The key to a successful Office 365 implementation is adoption
 
Office 365 Video
Office 365 VideoOffice 365 Video
Office 365 Video
 
10 Steps to be Successful with Enterprise Search
10 Steps to be Successful with Enterprise Search10 Steps to be Successful with Enterprise Search
10 Steps to be Successful with Enterprise Search
 
How the Cloud Changes Business Solution Design and Delivery
How the Cloud Changes Business Solution Design and DeliveryHow the Cloud Changes Business Solution Design and Delivery
How the Cloud Changes Business Solution Design and Delivery
 
Scaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other ToolsScaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other Tools
 
SharePoint 2013 Search Operations
SharePoint 2013 Search OperationsSharePoint 2013 Search Operations
SharePoint 2013 Search Operations
 
Office Online Server 2016 - a must for on-premises installation for SharePoin...
Office Online Server 2016 - a must for on-premises installation for SharePoin...Office Online Server 2016 - a must for on-premises installation for SharePoin...
Office Online Server 2016 - a must for on-premises installation for SharePoin...
 
Custom Code-The Missing Piece of the SharePoint Governance Puzzle
Custom Code-The Missing Piece of the SharePoint Governance PuzzleCustom Code-The Missing Piece of the SharePoint Governance Puzzle
Custom Code-The Missing Piece of the SharePoint Governance Puzzle
 
SharePoint 2016 Hybrid Sites Inside Out
SharePoint 2016 Hybrid Sites Inside OutSharePoint 2016 Hybrid Sites Inside Out
SharePoint 2016 Hybrid Sites Inside Out
 
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
 
What's New for the BI workload in SharePoint 2016 and SQL Server 2016
What's New for the BI workload in SharePoint 2016 and SQL Server 2016What's New for the BI workload in SharePoint 2016 and SQL Server 2016
What's New for the BI workload in SharePoint 2016 and SQL Server 2016
 
Creating a Great User Experience in SharePoint
Creating a Great User Experience in SharePointCreating a Great User Experience in SharePoint
Creating a Great User Experience in SharePoint
 
Introduction to AngularJS with the Microsoft Graph
Introduction to AngularJS with the Microsoft GraphIntroduction to AngularJS with the Microsoft Graph
Introduction to AngularJS with the Microsoft Graph
 

Recently uploaded

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 

Recently uploaded (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 

Advanced SharePoint 2013 Workflow for Developers

  • 1. Advanced SharePoint 2013 Workflow for Developers PAOLO PIALORSI, PIASYS PAOLO@PIALORSI.COM SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013 ZAGREB, NOVEMBER 27-28 2013
  • 3. Something about me • Consultant, project manager and trainer • More than 40 Microsoft certification exams passed • Microsoft Certified Solution Master – Charter SharePoint • Focused on SharePoint since the beginning • Author of 10 books about XML, SOAP, .NET, LINQ and SharePoint • • • Microsoft SharePoint 2010 Developer Reference, Microsoft Press Microsoft SharePoint 2013 Developer Reference, Microsoft Press Build Windows 8 Apps with Microsoft Visual C# and Visual Basic Step by Step, Microsoft Press • Speaker at main IT conferences
  • 4. Agenda • SharePoint 2013 and Workflow Manager (quick recall) • Advanced workflows with SharePoint Designer 2013 • Custom actions and activities with Visual Studio 2013 • Workflow Security • Workflow Forms
  • 5. SHAREPOINT 2013 AND WORKFLOW MANAGER
  • 6. SharePoint 2013 and Workflow Manager Access Control SharePoint 2013 Content People Sharing 2010 WF OAuth _API (REST OM) Workflow Manager Workflow Services Manager Instances Deployment Interop Messaging WF Service Application Proxy Workflow Client SharePoint Designer Visual Studio Events Service Bus
  • 9. But something is missing … • Move File • Upload File • Search • Publish/Approve Document • Save data on a backend database • Etc.
  • 10. BUT WE HAVE REST APIS • Support XML/OData/JSON format • Can be used to query (OData) contents • Can be used to manage (add, update, delete) content • Make the Client Side Object Model (CSOM) remotely available via REST • Useful for JavaScript/jQuery consumers • But also for workflows in SPD2013 or Visual Studio 2012/2013 _api is new alias for _vti_bin/client.svc Server Client REST OData JSON CSOM JavaScript Library Silverlight Library Custom Client Code .Net CLR Library
  • 11. _api Reference Web Application Hostname API Namespace http(s)://{Host Name}/{site}/_api/{namespace}/ {object} {property} {indexer(index)} {method({parameter},{parameter},…)} Site Collection (Optional) Operation
  • 12. Sample URLs • _api/web/lists • _api/web/lists/getByTitle(‘Documents') • _api/web/Lists/getByTitle('Documents')/Items • _api/web/Lists/getByTitle('Documents')/Items(4) • _api/web/CurrentUser • _api/web/SiteUsers • _api/web/getAvailableWebTemplates(lcid=1033) • _api/web/RoleAssignments/GetPrincipalId(1)/Member
  • 13. USING REST API FROM WORKFLOWS IN SPD2013
  • 14. CUSTOM ACTIONS AND ACTIVITIES WITH VISUAL STUDIO 2013
  • 15. Custom Activities vs Custom Actions Custom Activity Custom Action • Custom element from Visual Studio perspective • Minimal functional element of a workflow definition • Custom element from SPD2013 perspective • Wraps an activity or an aggregation of activities • Can be an Action or a Condition • Reusable in SharePoint Designer • Deployable through Sandboxed Solutions • Supported in Office 365! • Defined one time, reusable many times • Come in two flavors • Declarative: XAML • Code based: .NET Type • Reusable in Visual Studio and in SharePoint Designer • Complex deployment • Not available in Office 365!
  • 16. We can create libraries of custom actions • Reusable in multiple workflow definitions • Reusable in multiple site collections • Maintainable (are based on WSP, and WSP are upgradable …) • Some «common» examples • • • • Create New List/Library Delete List/Library Publish a document «Pending» approval Invoke remote HTTP services (REST/JSON/OData)
  • 17. CREATING A CUSTOM ACTION FOR SPD2013 IN VS2013 (PART 1)
  • 18. Creating a Custom Action (recap) • Create a Sandboxed Solution • Add a «Workflow Custom Activity» • Design the markup-based activity • You can’t use code • Define the .actions4 file • It will be registered in the target site collection • Package and deploy the WSP • Close SPD2013 and clear cache • C:Users{UserName}AppDataLocalMicrosoftWebsiteCache{site} • Restart SPD2013 and use the custom action
  • 19. Creating a Custom Activity (reference only) a Workflow «Activity Library» project • Create • Add a class and inherit from the proper base Activity type • CodeActivity, CodeActivity<T> • AsyncCodeActivity, AsyncCodeActivity<T> • NativeActivity, NativeActivity<T> • Implement .NET code • Create an .actions4 file • It will be placed in TEMPLATE{LCID}Workflow folder • Add the assembly to the Global Assembly Cache (GAC) • Create an AllowedTypes.xml file • %ProgramFiles%Workflow Manager1.0WorkflowArtifacts • %ProgramFiles%Workflow Manager1.0WorkflowWFWebRootbin • IISRESET + Restart «Workflow Manager Backend» service • Close SPD2013, clear cache, restart SPD2013 and use the activity
  • 21. A Workflow is like an App • The workflow engine has an App Principal • You can manage app principals: • https://{hostname}/sites/{site}/_layouts/15/appprincipals.aspx?Scope=Web • https://{hostname}/sites/{site}/_layouts/15/appinv.aspx • https://{hostname}/sites/{site}/_layouts/15/appregnew.aspx
  • 22. Default permission model • By default a workflow has write only permissions • And while working leverages both • User permissions • Workflow App permissions User Permissions App Permissions Workflow Permissions
  • 23. CREATING A CUSTOM ACTION FOR SPD2013 IN VS2013 (PART 2)
  • 24. App Step and AppOnlySequence (recap) • You can configure a web site to «Allow workflows to use app permissions» • Assign «Full Control» to the workflow App Principal (appinv.aspx) <AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" /> </AppPermissionRequests> • And Trust it!
  • 26. Understanding Workflow Forms • Every workflow definition can have • Association Form: to associate a workflow definition to a target (0 or 1) • Initiation Form: to start a workflow instance on a target (0 or 1) • Task Forms: to provide custom UI for tasks (0 or more) • Are common ASPX pages • Visual Studio 2012/2013 provides item templates for • Association and Initiation • You need to manually define task forms • Leveraging custom Workflow Task content types and custom task lists
  • 27. Workflow Forms and Kind of Projects • In Full Trust workflow projects • Can run server-side code (SharePoint Server Object Model) • Can do averything (they are full-trust) • Are not support for cloud-based (Office 365) deployments • In App for SharePoint projects • Workflows are available in app-web only • In a SharePoint-hosted app-web you can run only JavaScript code (!) • The form templates provided by Visual Studio are JavaScript based • You will have to interact with the Workflow Services Manager
  • 28. Workflow Services Manager Workflow Services Manager Deployment Service Instance Service Subscription Service Messaging Service Interop Service
  • 31. thank you. SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013 ZAGREB, NOVEMBER 27-28 2013

Editor's Notes

  1. Fiddlerhttps://pialorsi.sharepoint.com/sites/Workflows/_api/web/Lists/GetByTitle(&apos;Documents&apos;)/Items?$select=ID,TitlePoi SPD2013
  2. Show MoveFile Custom Action in VS2013and in SPD2013 (skip security)
  3. http://msdn.microsoft.com/en-us/library/jj822159.aspx
  4. Show AppOnly deployment and security in MoveFile
  5. http://msdn.microsoft.com/en-us/library/jj822159.aspx
  6. Show Custom WF Forms with Init and TaskResult before, code after