zoukankan      html  css  js  c++  java
  • Asp.net工作流workflow实战之给书签命名(四)

    之前我们的书签名字是通过手动录入的方式,在实际开发中要在流程设计的时候定义好:

    namespace EazyBPMS.WorkFlow
    {
    
        public sealed class SetStepActivity : CodeActivity
        {
            // 定义一个字符串类型的活动输入参数
            public InArgument<string> StepName { get; set; }
            public InArgument<bool> IsEnd { get; set; }
    
            // 如果活动返回值,则从 CodeActivity<TResult>
            // 并从 Execute 方法返回该值。
            protected override void Execute(CodeActivityContext context)
            {
                // 获取 Text 输入参数的运行时值
                string text = context.GetValue(this.StepName);
                bool end = context.GetValue(this.IsEnd);
                Guid insId = context.WorkflowInstanceId;
                //更新步骤名
                //根据流程id取得流程实例
                BLL.eazy_wf_instance instBll = new BLL.eazy_wf_instance();
                Model.eazy_wf_instance instModel = instBll.GetModel(insId);
                //根据流程实例id 和当前状态读取当前步骤
                BLL.eazy_wf_step stepBLL = new BLL.eazy_wf_step();   
                //报错的地方呢      
                EazyBPMS.Model.eazy_wf_step stepModel = stepBLL.GetCurrentModel(instModel.ID);
                stepModel.StepName = text;
                stepModel.IsEndStep = end;
    
    
                //是不是结束步骤更新一下
                if (end)
                {
                    //步骤的结果 Result=“审核结果”
                    stepModel.Result = "审批结束";
                    //更新实例表中的状态
                    instModel.Status= (short)EazyEnums.WFInstanceStatusEnum.End;
                    instBll.Update(instModel);
    
                }
                // 更新步骤信息
                stepBLL.Update(stepModel);
    
    
            }
        }
    }
  • 相关阅读:
    LeetCode 17. Letter Combinations of a Phone Number (电话号码的字母组合)
    Mordern Effective C++ --auto
    modern effective C++ -- Deducint Types
    基于锁的并发数据结构
    C++ 内存模型
    zlib 简单封装
    assert 实现分析
    Valgrind 快速入门
    kmp算法理解与记录
    make 要点简记
  • 原文地址:https://www.cnblogs.com/yabisi/p/6056892.html
Copyright © 2011-2022 走看看