• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
SharePoint workflow deep-dive

SharePoint workflow deep-dive



My presentation to the UK SharePoint User Group in January 2008 on SharePoint workflow. During the presentation I developed a state-machine workflow over several demonstrations. A downloadable ...

My presentation to the UK SharePoint User Group in January 2008 on SharePoint workflow. During the presentation I developed a state-machine workflow over several demonstrations. A downloadable \'resources pack\' of workflow tips and tricks accompanied this presentation, available at http://www.sharepointnutsandbolts.com/2008/01/resources-from-my-workflow-deep-dive.html.



Total Views
Views on SlideShare
Embed Views



2 Embeds 9

http://www.slideshare.net 6
http://www.linkedin.com 3



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • Show of hands for who has done workflow development/which kind

SharePoint workflow deep-dive SharePoint workflow deep-dive Presentation Transcript

  • 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
    • Different workflow types:
      • VS workflows require coding ability (and ideally InfoPath knowledge)
      • SPD workflows can be powerful, but limitations
      • Standard workflows simple to use
    • 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