2

我想使用 Visual Studio 创建状态机工作流,在编辑分配的任务时用户应该获得批准-拒绝按钮。目前我正在获得 % Completed 选项。

当我尝试使用 SharePoint Designer 2013 分配任务时,我的编辑任务被重定向到“_layouts/WrkStat.aspx”页面,其中有批准/拒绝按钮。但是当我用 Visual Studio 尝试它时,它会重定向到 EditForm.aspx 页面,我没有得到批准/拒绝按钮。

这是我的工作流元素文件。

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
    Name="SMW-WF"
    Description="Approve Reject Leave Request"
    Id="GUID"
    CodeBesideClass="SMW.WF.WF"
    CodeBesideAssembly="$assemblyname$",
    StatusUrl="_layouts/WrkStat.aspx">
    <Categories/>
    <MetaData>
        <AssociateOnActivation>false</AssociateOnActivation>
    </MetaData>
</Workflow>

谁能指导我如何将我的编辑任务页面重定向到 _layouts/WrkStat.aspx 页面或将批准/拒绝按钮添加到任务的 editform.aspx 页面。

谢谢你。:)

4

1 回答 1

1
  1. 将应用程序页面添加到状态机工作流并将其命名为 customTaskForm.aspx。您可以在此处对任务表单进行所有自定义。

  2. 向工作流项目添加内容类型。父内容类型应为 Workflow Task(0x0108)。内容类型的 element.xml 应该是这样的: enter image description here

注意:将 <> 替换为您的工作流项目名称。

  1. 在工作流设计器中,从工具箱中添加“CreateTaskWithContentType”。在各自的方法中,你要提供的内容类型id可能是这样的:this.createTaskWithCT_ContentTypeId1 = "GUID of The Content Type"(从内容类型的element.xml中获取)

祝你好运..

于 2016-02-23T19:33:53.807 回答