简体   繁体   English

Sharepoint顺序工作流未将任务添加到任务列表

[英]Sharepoint Sequential Workflow not adding Task into Tasklist

After the deployment of the workflow onto the sharepoint site, I am able to start the workflow by creating new rows of a list. 将工作流部署到共享点站点上之后,我可以通过创建列表的新行来启动工作流。 These are also reflected in the field, "no. of workflow in progress". 这些也反映在“正在进行的工作流数量”字段中。 However, I cannot seem to find the tasks created for specific users in the Task list. 但是,我似乎在“任务”列表中找不到为特定用户创建的任务。

As a beginner with Sharepoint development, I am not exactly sure what is wrong. 作为Sharepoint开发的初学者,我不确定是哪里出了问题。 Please kindly advise. 请指教。

this is my tested code: 这是我测试过的代码:

    private void OnCreateTask_MethodInvoking(object sender, EventArgs e)
    {
        taskId1 = Guid.NewGuid();
        //   SPContentTypeId myContentTypeId=new SPContentTypeId("0x01080100e73fd5f172cb40d8a5dca97fad7a58b8");
        SPContentType myContentType = SPContext.Current.Web.ContentTypes["Powerfull Approval Workflow Task"];
        CreateTaskApproval_ContentTypeID = myContentType.Id.ToString();
        #region Enable ContentTypes
        if (this.workflowProperties.TaskList.ContentTypesEnabled != true)
        {
            workflowProperties.TaskList.ContentTypesEnabled = true;
        }
        bool contenTypeExists = false;
        foreach (SPContentType contentType in workflowProperties.TaskList.ContentTypes)
        {
            if (contentType.Name == myContentType.Name)
            {
                contenTypeExists = true;
                break;
            }
        }
        if (contenTypeExists != true)
        {
            workflowProperties.TaskList.ContentTypes.Add(myContentType);
        }
        myContentType.EditFormUrl = "_layouts/SequentialWorkflow/TaskEdit/TaskEditForm.aspx";
        myContentType.DisplayFormUrl = "_layouts/SequentialWorkflow/TaskEdit/TaskEditForm.aspx";
        myContentType.Update();
        #endregion
        taskProperties.PercentComplete = (float)0.0;
        taskProperties.AssignedTo = myInstantiationData.User;
        taskProperties.DueDate = myInstantiationData.DueDate;
        taskProperties.Description = myInstantiationData.Request;
        taskProperties.StartDate = DateTime.Now;
        taskProperties.Title = "Please approve " + this.workflowProperties.Item.DisplayName;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM