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]

  • 相关阅读:
    SqlServer CDC的使用
    javabean的自省机制
    javascript验证汉字,字符,等正则表达式
    温习ASP调用C#的DLL并实现用户名密码进行域验证反馈结果
    基于RSA算法在asp中加密与解密对应的函数
    SQL查询所有表,字段名,主键,类型,长度,小数位数,允许空,默认值,字段说明
    c语言文法定义
    0909对编译原理的了解
    语法分析
    1112评论
  • 原文地址:https://www.cnblogs.com/PeterHome/p/3924639.html
Copyright © 2011-2022 走看看