SharePoint Developer Center >
SharePoint Products and Technologies Forums
>
SharePoint - Workflow
>
Triggering sharepointworkflow
Triggering sharepointworkflow
- Hi all,
i have a sharepoint workflow and it is customised according the to the .cs code in it. However i have a customised webpart with a button which is suppose to trigger the sharepoint. Any idea how this two can be link? or any reference site that i can refer to etc?
Hope to hear from your guys soon.
Thanks.- Moved byMike Walsh MVPMVP, ModeratorSaturday, November 07, 2009 10:18 AMwf q (From:SharePoint - Development and Programming)
Answers
- Hi Eric,
If your workflow is a a SharePoint workflow, then you get the required information in the referenced articles. I don't think I can give you a more detailed description, than you can find in those articles. Create your webpart and the button as a child control, and start the workflow in the onclick event handler of the button, as shown in the articles.
If your workflow is not a SharePoint workflow, you should go with standard Workflow Foundation knowledge. In this case the webpart is only a simple user interface for you. You can find general WF discussions on this forum:
Windows Workflow Foundation
http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/threads
for starting WF workflows from ASP.NET
Sample code for calling a workflow from asp.net
http://social.msdn.microsoft.com/forums/en-US/windowsworkflowfoundation/thread/489ddfa9-a1c3-455c-a934-6f9538967b1d/
Sorry, but I can't (and don't want to) do the job on behalf of you, just can try to help you with general recommendations or if you have exact technical questions, I can give you exact technical answers.
Peter- Marked As Answer byXue-Mei Chang-MSFTMSFT, ModeratorFriday, November 13, 2009 10:04 AM
All Replies
- Hi Eric,
SharePoint workflows usually associated with an item, that has been changed. So the best practice is to trigger the workflow by changing / creating an item, that will start the workflow based on the workflow registration settings.
If you have to start it directly, I suggest you to read these articles:
Howto Start a Sharepoint Workflow Programmatically
http://www.tonytestasworld.com/post/Howto-Start-a-Sharepoint-Workflow-Programmatically.aspx
How to start workflow programmatically
http://www.sharepointkings.com/2008/09/how-to-start-workflow-programmatically.html
Starting a SharePoint workflow from code
http://www.zimmergren.net/archive/2009/01/25/starting-a-sharepoint-workflow-from-code-event-receiver.aspx
Hope that helps you to solve your issue.
Peter - Hi Peter,
I am not sure exactly how the steps going to work but the workflow is customised using sequential workflow (Visual Studio) with multiple if-else activity . Using will click on a button from the customised webpart to execute the workflow. Possible to provide a detailed steps in this aspect?
Thank You very much
- Hi Eric,
If your workflow is a a SharePoint workflow, then you get the required information in the referenced articles. I don't think I can give you a more detailed description, than you can find in those articles. Create your webpart and the button as a child control, and start the workflow in the onclick event handler of the button, as shown in the articles.
If your workflow is not a SharePoint workflow, you should go with standard Workflow Foundation knowledge. In this case the webpart is only a simple user interface for you. You can find general WF discussions on this forum:
Windows Workflow Foundation
http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/threads
for starting WF workflows from ASP.NET
Sample code for calling a workflow from asp.net
http://social.msdn.microsoft.com/forums/en-US/windowsworkflowfoundation/thread/489ddfa9-a1c3-455c-a934-6f9538967b1d/
Sorry, but I can't (and don't want to) do the job on behalf of you, just can try to help you with general recommendations or if you have exact technical questions, I can give you exact technical answers.
Peter- Marked As Answer byXue-Mei Chang-MSFTMSFT, ModeratorFriday, November 13, 2009 10:04 AM


