SP2010: How to start a workflow which is not related to a document or list item?
-
16-10-2019 - |
문제
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?
해결책
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...
다른 팁
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.
Use this code:
var ass = web.WorkflowAssociations.GetAssociationByName("Change Request Approval", CultureInfo.InvariantCulture);
web.Site.WorkflowManager.StartWorkflow(null, ass, ass.AssociationData, SPWorkflowRunOptions.Synchronous);