• 生命周期的使用


    1.需求

    2.步骤

    2.1先创建用户类型

    2.2在后台编辑流程主键和DCParm

    LifeCycleZYQProcessor

    @DCComponent(namespace = "IDaaS系统.60_测试.题目七.流程组件", displayName = "LifeCycleZYQProcessor", description = "执行添加后修改init的值为true的流程"
            + "Processor",
            type = DCType.Processor)
    @Component
    @Scope(value = "prototype")
    public class LifeCycleZYQProcessor extends AbstractDynamicComponent<NoConfig> implements
            IProcessor<LifeCycleInput, ResultOutput> {
    
        @Autowired
        private SearchService searchService;
    
        @Autowired
        private DataStoreService dataStoreService;
    
        @Override
        public void init() {
        }
    
        @Override
        public ResultOutput runProcess(LifeCycleInput input) {
            Map data = input.getData();
            data.put("init",true);
            dataStoreService.updateData(data,"IDaaS系统.60_测试.题目七.Person",true);
            ResultOutput resultOutput = new ResultOutput();
            resultOutput.setResult(true);
            return resultOutput;
        }
    }
    

    LifeCycleInput

    @DCParam(namespace = "IDaaS系统.60_测试.题目七.LifeCycleZYQProcessor", displayName = "AccountPwdInput")
    public class LifeCycleInput {
    
        @DCParamAttr(displayName = "数据", description = "数据-map", required = true)
        public Map data;
    
        public Map getData() {
            return data;
        }
    
        public void setData(Map data) {
            this.data = data;
        }
    }
    

    ResultOutput

    @DCParam(namespace = "IDaaS系统.60_测试.题目七.LifeCycleZYQProcessor", displayName = "ResultOutput")
    public class ResultOutput {
    
        @DCParamAttr(displayName = "Result", description = "Result", required = false)
        private Boolean result;
    
        public Boolean isResult() {
            return result;
        }
    
        public Boolean getResult() {
            return result;
        }
    
        public void setResult(Boolean result) {
            this.result = result;
        }
    }
    

    过后重启adminapplication

    2.3创建流程LifeCycleTest

    2.3.1编辑流程

    配置流程

    编辑start

    编辑进程节点

    编辑输入配置

    编辑end

    此处无end,不填

    保存发布流程

    2.4 创建生命周期

    点击用户类型——》点击生命周期管理器——》添加流程(为刚才创建的流程)

    如果代码没问题的话,生命周期就配置成功了

  • 相关阅读:
    GetHub下载不成功
    Cache 判断Ip几分钟内攻击次数
    .net 通过Url获取站点json数据
    Linq 读取Xml 数据
    ef Linq 自定义字段列表
    面试的心得
    触发器--单独字段变化另一个字段也变化
    Ajax跨域 取值 Jsonp的定义注意事项
    asp.net里,各种下载方式汇总
    c# 获取硬件信息
  • 原文地址:https://www.cnblogs.com/psyduck/p/16107559.html
Copyright © 2020-2023  润新知