【发布时间】:2009-12-02 21:36:50
【问题描述】:
我创建了一个 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。我该如何进行这项工作,或者有没有更好的方法在自定义工作流中调用另一个工作流?
【问题讨论】:
标签: c# sharepoint workflow workflow-foundation