• 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);
    
    
            }
        }
    }
  • 相关阅读:
    从命令行接收多个数字,求和之后输出结果(Java)
    《大道至简》第一章——编程的精义_读后感(Java伪代码)
    《构建之法》阅读笔记03
    《构建之法》阅读笔记02
    《构建之法》阅读笔记01
    Javaweb所用到的相关技术综述
    TomCat的安装与配置
    心形曲线
    异常处理---动手动脑及课后作业
    多态---课后作业
  • 原文地址:https://www.cnblogs.com/yabisi/p/6056892.html
Copyright © 2020-2023  润新知