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]

  • 相关阅读:
    NetBeans 时事通讯(刊号 # 4 Apr 22, 2008)
    设计演化与设计
    关于奥普迪词典软件竞赛的一点体会、抱怨与建议
    关于奥普迪词典软件竞赛的一点体会、抱怨与建议
    Ubuntu8.04已经可以索要免费CDs了!
    NetBeans 时事通讯(刊号 # 3 Apr 15, 2008)
    SQL行列转换
    STL中map用法详解
    MFC 网络编程 总结 .
    Visual C++内存泄露检测—VLD工具使用说明 .
  • 原文地址:https://www.cnblogs.com/PeterHome/p/3924639.html
Copyright © 2011-2022 走看看