簡體   English   中英

工作流模板沒有為此頁面指定FormURN關聯現成的SharePoint 2010發布批准工作流時出錯

[英]The workflow template has specified no FormURN for this page Error when Associating Out of the box SharePoint 2010 publihsing approval workflow

您好,我已經將一個從Sharepoint Designer 2013導入到Visual Studio 2012的SharePoint 2010發布審批工作流與Visual Studio中的導入Sharepoint 2010工作流項目相關聯。 我還用C#調用了工作流,如下所示:

 public void AddWorkflowAssociationToPagesList(SPList assoicationList, string spWorkflowTemplateGuid)
        {

            try
            {

                SPWorkflowTemplate workflowTemplate =
                    _web.WorkflowTemplates.GetTemplateByBaseID(new Guid(spWorkflowTemplateGuid));

                if (workflowTemplate == null) { _logger.LogError(LoggingCategory.Workflow, "Error in associating workflow with guid: " + spWorkflowTemplateGuid + " The workflowtemplate does not exist in: " + _web.MasterUrl); }

                SPList pagesList = _web.Lists[PublishingWeb.GetPagesListName(_web)];

                if (workflowTemplate != null)
                {
                    var taskList = _listProvisioner.TryGetList(_web, _localaizedWorkFlowTaskList, string.Empty, true, SPListTemplateType.Tasks);
                    var historyList = _listProvisioner.TryGetList(_web, _localaizedWorkFlowHistoryList, string.Empty, true, SPListTemplateType.WorkflowHistory);

                    SPWorkflowAssociation workflowAssocaition = SPWorkflowAssociation.CreateListAssociation(workflowTemplate,_workflowAssociationName, taskList, historyList);
                    assoicationList.WorkflowAssociations.Add(workflowAssocaition);

                    _web.AllowUnsafeUpdates = true;
                    assoicationList.DefaultContentApprovalWorkflowId = workflowAssocaition.Id;
                    assoicationList.Update();
                    _web.AllowUnsafeUpdates = false;
                }
            }
             catch (Exception ex)
            {
                _logger.LogError(LoggingCategory.Workflow, "Error: " + ex + " in associating workflow with id: " + spWorkflowTemplateGuid);                
            }   
        }

當我嘗試在頁面庫中發布頁面時發生錯誤:工作流模板未為此頁面指定FormURN

ULS日志在相關ID上為我提供了此信息:

Application error when access /_layouts/15/IniWrkflIP.aspx, Error=The workflow template has specified no FormURN for this page.  
 at Microsoft.Office.Workflow.IniWrkflIPPage.LoadFromWorkflowAssociation()    
 at Microsoft.Office.Workflow.IniWrkflIPPage.OnLoad(EventArgs ea)    
 at System.Web.UI.Control.LoadRecursive() 
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean    includeStagesAfterAsyncPoint)

如果我將工作流的開始條件更改為在庫中創建新項目時才開始,僅當通過發布頁面啟動工作流時才發生。

有人遇到過這種問題嗎?

問候。

您是否要從頁面本身的功能區發布它? 不幸的是,該部分完全取決於起始表單是InfoPath表單而不是ASP.Net表單。 但是,如果您嘗試通過checkin / major進行發布,或者通過Pages庫上的上下文菜單來發布主要版本,則會發現它可以正常工作。 讓我知道您是兩種方式都獲得相同的行為,還是僅在頁面本身功能區中的按鈕上均得到相同的行為。

暫無
暫無

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

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