Welcome to MSDN Blogs Sign in | Join | Help

Developing Workflows in VS: Part 7 - Summary and Final Thoughts

You might feel a little intimidated; there’s a lot to think about and understand.  But don’t worry!  Like I said before, there are just a few key things to really get your head around, and once you can see how they all fit together, the world of workflow will unfold before your eyesJ (or at least make a little more sense;)).  The key takeaways are this: 

1)      Understand the difference between Template, Association, and Instance. The docs will make a lot more senseJ.  Instances come from associations, which come from templates defined by a workflow.xml. 

2)      A little high-level planning of not just the workflow, but its surrounding lists and items, can go a long way.

3)      A workflow can only respond to events that are registered through workflow services.  You must use the SharePoint activities (i.e. the workflow service APIs) to create your items if you want to register your workflow for events on those items.

4)      Data binding with forms is one of the most confusing parts of workflow development.  Just remember:

a.       Your form pages call an OM function that wakes up a workflow via the workflow service.  Each function calls the host, which takes your form data parameter and passes it into the corresponding workflow event receiver activity.

b.      Forms can be either aspx or InfoPath (hosted in an aspx page).   But InfoPath provides benefits, such as client integration, easy authoring, and no code.

c.       If you use IP forms, use the names of your controls to refer to those values inside your workflow (i.e. the data  uses the same schema as your form)

d.      Follow the checklist of steps for InfoPath forms to set them up for data submission.

e.      Tasks are different from the other workflow objects, in how form data is saved (directly to the task instead of into the workflow), how data is received inside the workflow (an SPWorkflowTaskProperties object instead of a string), and how it is defined in the workflow.xml (a content type rather than a page).

5)      When you’re ready to deploy a workflow, fill out a feature.xml and workflow.xml, then use stsadm to install it (the VS templates help automate this).

6)      Debug your workflow by attaching to a live server.  Use breakpoints and the ULS logs to figure out what’s wrong.

Use this guide with the samples in the ECM Starter Kit, which are meant to build on concepts.  Start with HelloWorld to understand InfoPath forms and correlation basics, then move on to Modifications or Replicator.  Developing workflows just takes a little practice, so take it one step at a time. 

Anyway, thanks for reading!  I hope this has been helpful!  I've attached to this entry the full guide doc for this series, which includes a few extra charts and diagrams.   Good luck, and happy workflow everyone! 

-Eilene 

Published Friday, December 01, 2006 9:00 AM by sptblog
Filed under:

Attachment(s): So You Want to Develop Custom SharePoint Workflows.pdf

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

how about examples workflow on aspx forms?

Friday, December 01, 2006 11:31 AM by hEAD

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Thank you for such a great set of posts, its really been very helpful.   I do have one question regarding IP and ASPX  forms.  

My understanding is that WSS v3 doesn't support using IP forms for the WF process steps (Assoc, Init, Task & Mod) out of the box.

Can IP forms be used with WSS if the server is running Form Server?  If so,  are the canned IP forms that house the XMLHost control available separately anywhere?

thanks,

ford

Friday, December 01, 2006 11:47 AM by Ford Prefect

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Eilene, fantastic series on workflow; this is much needed information!  Two requests: where is the link to the attachment, and I second the motion for tutorial using aspx forms instead of InfoPath... we need that technique too!  Many thanks, Mark.

Friday, December 01, 2006 11:13 PM by Mark Arend

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

I need to make a state machine WF where every task assign to a user must provide info to the same form, how can i do that? Thx

Sunday, December 03, 2006 10:50 PM by Jorge

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Oops, attached the doc;)

hEAD and Mark, I will try to put together a post on aspx pages:) But the point I was hoping to convey in the forms section (perhaps unsuccessfully;))was that it's really not all that different from IP.  I mean, in reality, IP forms are basically just UI for some oob aspx pages, so the only real extra things you need to if you're doing your own aspx pages is use asp.net controls and call the correct workflow OM function (and redirect I suppose).  This is kinda tedious, but conceptually straight forward and similar to InfoPath, which is why we don't have a whole lot of samples on it. The Collect Feedback provides most of the base forms, so it's a matter of taking that and tweaking the UI.

Jorge, I'm not sure I know what you mean by same form, but if you're referring to having the same data in every task form, perhaps you can update all tasks after someone submits their form, and it will appear to all be the same.  

Monday, December 04, 2006 10:06 PM by Eilene Hao

# OnePage Workflow in SharePoint 2007

OnePage : der einfache Blick auf das Wesentliche - die wichtigsten Informationen zu einem Thema auf einer

Tuesday, December 05, 2006 2:40 PM by SharePoint, SharePoint and stuff

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Thanks for the set of blogs. They have been very informative. I have been looking at customizing the built-in SharePoint Approval workflow such as modifying the default Workflow Status page (~/_layouts/WrkStat.aspx) with different messages and hints for the user. Is there an easy way I can do this within SharePoint itself or do I need to create a new workflow? If I do need to create a new workflow, how do I associate my custom workflow to use a custom Workflow Status page? If you have any insight into this I would really appreciate it. Thanks, Jennifer

Tuesday, December 05, 2006 5:17 PM by Jennifer

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Hi Jennifer,

Just create a custom page and stick it in the LAYOUTS directory (parallel to FEATURES).  In the workflow template xml file for the Approval workflow (in the ReviewWorkflows directory), underneath ModificationsUrl, add a StatusUrl="_layouts/yourpage.aspx".  You'll want to uninstall and reinstall the feature so that it uses the new changes.

-Eilene

Tuesday, December 05, 2006 10:31 PM by Eilene Hao

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Dev working with Information Services

Wednesday, December 06, 2006 1:26 PM by Jad

# Creating Workflows with Visual Studio 2005 (Walkthrough)

Im not sure how many have found this yet but Eileen Hao has put together a Seven Part walkthrough with...

Thursday, December 07, 2006 12:25 PM by Bob Fox's Sharepoint Blog

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Eilene,

Thanks for the blogs and the attached pdf.  The information you've given has helped me tremendously when developing custom SharePoint workflows.  I am writing a custom workflow right now and I initially created an IP form for the initiation of the workflow but have just hit that IP functionality wall where it's time to start adding custom code to it.  Are there any tips when adding custom code to workflow forms?  Should I publish the form and install/activate like I would a normal form now or will the installation/activation of the workflow handle this for me?  Do you have a recommendation/guidance as to when it's time to go to aspx forms from IP?

Thanks,

Bo

Thursday, December 07, 2006 9:14 PM by Bo George

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Hey Bo,

If you've got code behind your IP form, you might need give it full trust.  Deploying the workflow will deploy the form (you might need to GAC the assembly separately?  I haven't tried it, so if it doesn't work, give this a try).

In terms of going to aspx, you'll want to do this if you if you have special aspx controls that don't exist in InfoPath, or you find that a limitation in the code you write in the IP form.  But other than that, I guess it's a matter of preference for the developer.

Hope this helps,

Eilene

Friday, December 08, 2006 9:09 PM by Eilene Hao

# Site update and new links...

Site update and new links...

Tuesday, December 12, 2006 9:49 AM by Andrew Connell [MVP MCMS]

# SharePoint 2007 workflow development

Saturday, December 16, 2006 8:23 PM by Miguel Isidoro

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Bo,

Were you able to deploy your forms with custom code?  I am trying to do that and I haven't had any luck.  I gave the form (an edit task form) full trust and signed it, but when I try to edit the task in the workflow it doesn't open and I get the error "The form has been closed."  Any advice?

Thanks,

Cynthia

Tuesday, January 23, 2007 7:35 PM by Cynthia

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Dear Eilene,

I know this comment is too late, but i noticed that in the demos the initiation form and the association form are always refer to the same formUrn (IP Forms) i tried to write my own workflow and used different forms for initiation and association, but i got error while trying to initiate the workflow, the error was saying it cannot find the schema (the schema mentioned is the Association form schedma).

so how can i use 2 different forms for Association and initiation.

Also how can i make a workflow without initiation or association forms ?

i tried to remove the element from the xml file but it didn't work.

Thursday, January 25, 2007 5:03 AM by mozaki

# Start Learning Workflows!!

Wow such an exciting topic to learn!! its nice and fun yet its a bit difficult to grasp easily,,, This

Thursday, April 12, 2007 9:47 AM by Code Eater

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

the schema (the schema mentioned is the Association form schedma).

so how can i use 2 different forms for Association and initiation.

Also how can i make a workflow without initiation or association forms ?

i tried to remove the element from the xml file but it didn't work.

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Hi Eilene,

I have read all your 7 post on workflow, all are very informative.

Based on post I have created a sequential workflow with InfoPath form and it is executing correctly. Now I want to extend this sequential workflow where if the first approver is not approving the form in stipulated time than the workflow task should divert to other user for approval.

I have used Delay activity/Policy control but with both I am not able to divert my task to different approver.

Can you provide any pointer to this problem?

TIA,

Amit

Wednesday, April 25, 2007 1:45 AM by Amit

# Windows SharePoint Services 3.0 SDK April 2007 Revision

There is a new Windows SharePoint Services 3.0 SDK April 2007 Revision available. Site: http://msdn2.microsoft.com/en-us/library/ms441339.aspx

Friday, April 27, 2007 5:27 AM by Raul Ribeiro

# How do you update a item string field to null/empty?

I'm trying to update a string field (e.g. comments)in a list to be empty (I use this field for testing)... the best I can do is set it to a space .... any thoughts?  If you do not set a value for a field in "Update List Item", it does not update the field

Wednesday, August 29, 2007 10:52 AM by bbarthel

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Although aspx forms are "basically like InfoPath forms", it would be helpful to have a step-by-step guide to craeting a workflow with just aspx code (no MOSS pages or short cuts).

Monday, September 10, 2007 1:06 PM by nw

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Hello all, thank you for looking at this post

Scenario:

I need to create an 'Absence Request' system which needs to do all of the following:

Allow all users to see when anyone is on holiday (I understand how to create a calendar view of data in a list)

When a request is submitted to the list ONLY their immediate manager and the submitter should be able to see the request.

An approval workflow should then be started to submit to their manager for approval

If approved then the item should be visible to all

The Problem:

Imagine this structure in the IT department:

Jay and John report into steve (Steve can approve their Holidays), Sally and Jane report into Andy (Andy can approve their Holidays), Andy and Steve report into Ian (Who can approve their holidays)

I have created a form library in sharepoint and published an infopath form to it for users to fill in. This automatically is populated with data from a database (using a web service) with such things as their name and their managers name and email address... so far so good.

They are then able to submit this form to the library and relevant metadata in the list is created, namely their ManagersEmail address.I am able to get an email fired off to the correct manager for approval.

The problem is is because Andy, Steve and Ian have 'Approver' rights in the form library, they can all approve anyones submission, even their own!

It is impractical to create a library for each approval level (as this is just one dept and there are 30 ish).

My thoughts

I thought about trying to filter the list to only show items where the ManagerEmail field is equal to the users who is looking at the list. I tried the web parts but none seemed to allow me to specify which field i wanted to compare against.

Tried to make it aso only the Manager could open entries where he was in the ManagerEmail column

Thought about audiences but got nowhere

The Big Question(s)

Is it possible to have a different level of approval for each item in a list? (set programatically)

Could i filter the list so only items with the current users email in the ManagersEmail field show?

Can i only allow the user in the ManagerEmail field to approve the request

Either i am missing something here or lots of people must be having this problem.

Thanks in advance.

Wednesday, October 17, 2007 3:28 PM by Simon Thompson

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Hi Eilene,

One portion of your post that is not covered is the management of workflow version as it evolves in time.

Thanks in advance.

Friday, November 02, 2007 3:20 PM by Dominic

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

Thanks man, It really helpful for beginners like me.

Friday, December 14, 2007 5:02 AM by Shrikant

# re: Developing Workflows in VS: Part 7 - Summary and Final Thoughts

RE: Simon

I have *exactly* the same problem. Has anyone any solutions?

I *also* have the problem where on another workflow, I have the valid need for someone with 'Approver' status to not have to approve their own entries (in a timesheet calendar). ie: *their* entries are automatically approved (because they are an approver...)

Any thoughts?

Wednesday, August 06, 2008 6:55 AM by Mark Fendley

# 应用SharePoint的Workflow须记住的10句话!

1)SharePoint的工作流是基于文档的工作流,只能关联到列表,文档库和内容类型上 2)SharePoint的工作流模板利用网站功能(Feature)来发布 3)SharePoint的...

Tuesday, September 23, 2008 11:14 PM by 晃晃悠悠

# 微软sharepoint产品组博客——使用VS进行工作流开发系列博客

最近的两个月一直在研究SharePoint的内容,从配置到开发,从配置,到sharepoint对象模型,webpart,eventhandler,workflow,contenttype,自定义字段...

Monday, November 24, 2008 12:36 AM by virus

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker