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]

  • 相关阅读:
    CCCC L2-023. 图着色问题【set去重判不同种类个数/简单图论/判断两相邻点是否存在同色以及颜色个数】
    百练 04 简单的整数划分问题
    NYOJ90 整数划分(经典递归和dp)
    图遍历问题
    图着色问题
    Java 大数(整数+浮点数) 基本函数
    根据规律绘制图形(俗称蛇皮走位)
    KMP算法之我见
    CCCC L1-039. 古风排版【图形输出/循环控制行列/模拟/细节】
    HYSBZ 2818 Gcd【欧拉函数/莫比乌斯】
  • 原文地址:https://www.cnblogs.com/PeterHome/p/3924639.html
Copyright © 2011-2022 走看看