5

I'm trying to build a "list" which is comprised of a bunch of workflows. Example workflows would be: Travel, Reimbursement, Software Request. I would like to list these workflows and allow a user to click the Software Request workflow to launch a new instance of the Software Request workflow. The workflows do not relate to a specific item in a list.

How would add a list of workflows to a page?

6

Since you have created site workflows and they don’t have a list item or document to start from, they must be started either:

1) manually - http://technet.microsoft.com/en-us/library/ee662540.aspx

or

2) Using API - example - http://unclepaul84.blogspot.com/2009/12/starting-sharepoint-2010-site-workflows.html

Let us know if you find a better way...

  • Thanks. I want to start them manually, that's fine. The question was more asking if there was an easy way to create a list of workflows so a user can just click the one they want to start. I was hoping to do this without having to keep all of the URLs updated and manually adding each one. – Josh M. Jun 9 '11 at 18:28
3

Create hyperlinks to the NewForm pages of the lists that hold the workflows. Workflows have to run on list or library items, so users have to submit something.

  • The second part isn't true - a "site" workflow is not based on a list. That's what I'm using. I was hoping there was another way to list a bunch of workflows without manually adding a link to each one. I'm sure I can do so with a little C#! – Josh M. Jun 9 '11 at 17:51
  • Site workflows are reusable workflows that can be attached to lists and libraries. Workflows can't run without being associated to a list or library item, or document set. – Eric Alexander Jun 9 '11 at 17:55
  • I appreciate your help but I don't think that's accurate. (imgur.com/TZDWx) I've created a "site" workflow and am able to start it from scratch. – Josh M. Jun 9 '11 at 18:05
  • I see what you mean. I'll admit my ignorance of 2010, I've only been able to go by what I've seen on blogs and podcasts as we haven't upgraded yet. You might be able to do something dynamic with a data view web part that gets it's data from the workflow web services or something with jquery and SPServices, spservices.codeplex.com/…. – Eric Alexander Jun 9 '11 at 18:30
0

Use this code:

    var ass = web.WorkflowAssociations.GetAssociationByName("Change Request Approval", CultureInfo.InvariantCulture);
    web.Site.WorkflowManager.StartWorkflow(null, ass, ass.AssociationData, SPWorkflowRunOptions.Synchronous);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.