簡體   English   中英

通過SharePoint中的自定義順序工作流調用工作流

[英]Invoke Workflow through Custom Sequential Workflow in SharePoint

我已經創建了SharePoint 2007順序工作流,並試圖以編程方式激活兩個工作流(一個批准和一個反饋)。

workflowProperties.Site.WorkflowManager.StartWorkflow(workflowProperties.Item, association, association.AssociationData, true);

我使用此代碼啟動工作流程,並快速創建了關聯。 當我嘗試訪問其他列表以創建關聯對象時,就會出現問題。

SPList approvalsList = workflowProperties.Web.Lists["Tasks"];
SPList historyList = workflowProperties.Web.Lists["Workflow History"];

這是我得到的:

Unable to cast COM object of type 'Microsoft.SharePoint.Library.SPRequestInternalClass' to interface type 'Microsoft.SharePoint.Library.ISPRequest'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{BDEADEBE-C265-11D0-BCED-00A0C90AB50F}' failed due to the following error: Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE)).

唯一可訪問的列表是通過workflowProperties.List。 我如何進行這項工作,或者在自定義工作流程中是否有更好的方法來調用另一個工作流程?

我使用有用的Sharepoint Designer自定義工作流程活動來啟動另一個工作流程。
如果您不能原樣使用它,請查看其源代碼。 看起來他們沒有手動設置任務和歷史記錄列表: http : //spdactivities.codeplex.com/SourceControl/changeset/view/22637#201408

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM