zoukankan      html  css  js  c++  java
  • Create Custom Modification Form In VS 2012-Part2

    1.SPWorkflowModification ContextData is XMLSerialized as String.

    2.Get SPWorkflowModification ContextData in modification page

      protected void GetContexData()
            {
                SPWeb currentWeb = SPContext.Current.Web;
                string strWorkflowInstanceId = Convert.ToString(Request["WorkflowInstanceID"]);
                string strModificationId =Convert.ToString(Request["ModificationID"]);
                string strListId = Convert.ToString(Request["List"]);
                SPWorkflow currentWorkflow = new SPWorkflow(currentWeb, new Guid(strWorkflowInstanceId));
                if (currentWorkflow!=null)
                {
                    SPWorkflowModification currentModification = currentWorkflow.Modifications[new Guid(strModificationId)];
                    txt_context.Text = currentModification.ContextData;
                }
            }

    3.Update SPWorkflowModification ContextData in modification page

        SPWeb currentWeb = SPContext.Current.Web;
                string strWorkflowInstanceId = Convert.ToString(Request["WorkflowInstanceID"]);
                string strModificationId = Convert.ToString(Request["ModificationID"]);
                string strListId = Convert.ToString(Request["List"]);
                SPWorkflow currentWorkflow = new SPWorkflow(currentWeb, new Guid(strWorkflowInstanceId));
                if (currentWorkflow != null)
                {
                    currentWeb.AllowUnsafeUpdates = true;
                    SPWorkflowModification currentModification = currentWorkflow.Modifications[new Guid(strModificationId)];
                    currentWeb.Site.WorkflowManager.ModifyWorkflow(currentWorkflow, currentModification, "111;222;333;444;555;666;777;");
                    SPUtility.Redirect("WrkStat.aspx", SPRedirectFlags.UseSource, Context);
                    currentWeb.AllowUnsafeUpdates = false;
                }
                else
                {
                    //SPUtility.Redirect("WrkStat.aspx", SPRedirectFlags.UseSource, Context);
                }

    4.Get SPWorkflowModification ContextData in Workflow

      workflowProperties.Workflow.Modifications[SPWorkflowModificationId]

  • 相关阅读:
    拨号进入防盗界面
    手机开机或启动广播接收者
    time、datetime
    py 包和模块,软件开发目录规范
    递归函数
    匿名函数,内置函数
    三元表达式,列表生成式,生成器生成式
    迭代器,生成器
    XPath
    闭包,装饰器
  • 原文地址:https://www.cnblogs.com/PeterHome/p/3924639.html
Copyright © 2011-2022 走看看