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]

  • 相关阅读:
    [转]你每天90%的注意力被浪费了
    通过浏览器navigator获取当前经纬度位置
    Sublime Text 3 安装、插件与个人配置
    ios判断手机号是否可用
    AFNetworking提示3840 Unescaped control character around character XXX
    理解OC“属性”这一概念
    熟悉Objective—C
    如何在自己的应用中打开第三方应用程序
    ios多线程开发总结
    UIView的Touch事件UIControlEvents详解
  • 原文地址:https://www.cnblogs.com/PeterHome/p/3924639.html
Copyright © 2011-2022 走看看