Benutzer:MovGP0/SharePoint/Workflow

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      


SharePoint 2010 vs 2013

[Bearbeiten | Quelltext bearbeiten]
SharePoint 2010 Limitations SharePoint 2013
  • only for on-premises (does not scale)
  • requires to be a box admin; only possible in farm solution
  • analytics on (current/previous) workflow instances buried in content databases
  • workflows are executed with super user privileges
  • Workflows run in Workflow Manager (WM)
    improves stability, scalability, and transparency
  • uses WF4 (Work Flow Foundation 4.0)
  • SP communicates with WM over WCF
  • No custom code allowed in WF4
    custom code must be called via a Webservice
  • WM uses CSOM and OAuth to access SP
    OAuth uses App ID and UserContext (user who initiated workflow)
  • supports SharePoint 2010 workflows
    • hosted in SharePoint context
    • InteropBridge to communicated between WF3.5 and WM/WF4 execution engines
    • InvokeSharePointWOrkflow activity used to send a start message to SharePoint worflow web service control endpoint

Activities and Actions

[Bearbeiten | Quelltext bearbeiten]
Workflow Activities and Actions in SharePoint 2013
Actions & Activities Project Specific Actions
  • Assign a Task
  • Start a Task Process
  • Go to This Stage
  • Call HTTP Web Service
  • Start a List Workflow
  • Start a Site Workflow
  • Build [Dictionary/DynamicValue]
  • Get Property from [Dictionary/DynamicValue]
  • Count Items in [Dictionary/DynamicValue]
  • Trim String
  • Find Substring in String
  • Replace Substring in String
  • Translage Document
  • Set Worfklow Status
  • Create a Project from Current Item
  • Set the current procject stage status to this value
  • Set the status field in the idea list item to this value
  • Wait for Project Event
  • Set this field in the project to this value
Workflow-Stage
  • has Entry Point and Gate (exit with goto)
  • WF4 flow step in a flowchart
  • can contain multiple steps (Actions)
  • SharePoint Designer loop limitations
Visio SharePoint Designer Visual Studio
  • basic modeling process
  • sharing with disconnected customers
  • text based & visual designer
  • for end user, power user, and developer
  • visual designer for modeling worflows
  • for developers
Declarative Ja Ja
Custom Code Nein Nein
Reusability
  • reusable
  • Content Type based workflows
  • Workflow templates
  • include workflows in apps
Include in Apps Nein Ja
Visio Integration Ja Nein
Custom Actions consume only create and consume
Debugging Nein Ja

Calling Custom Code

[Bearbeiten | Quelltext bearbeiten]
Overview Activities use Dictionary Process Core Actions
  • move custom code in workflows to web services
  • prefer OData web service
  • must support JSON format
  • can support authentication
  • can access SharePoint via CSOM, or REST and OAuth
  • support for GET, PUT, POST, DELETE, and MERGE verbs
  • Activities submit name-value pairs to service
  • name-value response is converted to dictionary
  1. build dictionary
  2. call service and store response in local Dictionary variable
  3. retrieve named items from response
  • Build Dictionary
  • Call HTTP Web Service
  • Count Items in a Dictionary
  • Get an Item from a Dictionary
using Visual Studio DynamicValue Activities
  • uses HttpSend activity
  • DynamicValue datatype to submit and receive service responses
    DynamicValue replaces Dictionary
  • DynamicValue supports hierarchical data (JSON)
  • BuildDynamicValue
  • ContainsDynamicValueProperty
  • CopyDynamicValue
  • CountDynamicValueItems
  • CreateDynamicValue
  • CreateUriFromDynamicValue
  • GetDynamicValueProperties
  • GetDynamicValueProperty<T>
  • IsEmptyDynamicValue
  • ParseDynamicValue

Create SharePoint Worfklow App in Visual Studio

[Bearbeiten | Quelltext bearbeiten]

→ New → Project → App for Sharepoint

→ add Customizeable List → create columns

→ add Workflow → "UpdateProductRequest" → Associate with List → WF is usually started when something is created

→ add activities to get info about current list item

GetCurrentListId
GetCurrentItemGuid
LookupSP...

→ use HttpSend to call external OData service; service must return JSON

→ use GetDynamicValueProperty<T> to extract values from result

→ use SetField to set value of List field

Install Workflow Service

[Bearbeiten | Quelltext bearbeiten]
  • install with WebPI
  • create Workflow-Account in AD; needs Admin-Rights
  • log in with Workflow-Account
  • register WF in SharePoint Management Shell:
# with HTTP
Register-SPWorkflowService -SPSite "http://myspsite.com" -WorkflowHostUri "http://mywfhost.com:12291" -AllowOAuthHttp

# with HTTPS
Register-SPWorkflowService -SPSite "http://myspsite.com" -WorkflowHostUri "https://mywfhost:12290" -AllowOAuthHttp