From f452398c953e3ccf05d270d436343dc3a73994d3 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Tue, 20 Aug 2024 20:46:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E9=80=9A=E7=9F=A5=E7=AD=96=E7=95=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1227345283743744]自动化通知策略增加触发点 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1227345283743744 --- .../AutoexecJobNotifyTriggerType.java | 25 ++++++- .../constvalue/AutoexecNotifyTriggerType.java | 68 +++++++++++++++++++ 2 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyTriggerType.java diff --git a/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobNotifyTriggerType.java b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobNotifyTriggerType.java index c748f4fa..0e615b4c 100644 --- a/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobNotifyTriggerType.java +++ b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobNotifyTriggerType.java @@ -18,19 +18,31 @@ package neatlogic.framework.autoexec.constvalue; import neatlogic.framework.notify.core.INotifyTriggerType; import neatlogic.framework.util.$; +import java.util.Arrays; +import java.util.List; + public enum AutoexecJobNotifyTriggerType implements INotifyTriggerType { - JOB_FAILED("jobfailed", "nfac.autoexecjobnotifytriggertype.text.jobfailed", "nfac.autoexecjobnotifytriggertype.description.jobfailed"), + JOB_FAILED("jobfailed", "nfac.autoexecjobnotifytriggertype.text.jobfailed", "nfac.autoexecjobnotifytriggertype.description.jobfailed", + Arrays.asList(JobStatus.FAILED.getValue())), + + JOB_COMPLETED("jobcompleted", "nfac.autoexecjobnotifytriggertype.text.jobcompleted", "nfac.autoexecjobnotifytriggertype.description.jobcompleted", + Arrays.asList(JobStatus.COMPLETED.getValue())), + + JOB_WAIT_INPUT("jobwaitinput", "nfac.autoexecjobnotifytriggertype.text.jobwaitinput", "nfac.autoexecjobnotifytriggertype.description.jobwaitinput", + Arrays.asList(JobStatus.WAIT_INPUT.getValue())), ; private final String trigger; private final String text; private final String description; + private final List jobStatusList; - AutoexecJobNotifyTriggerType(String _trigger, String _text, String _description) { + AutoexecJobNotifyTriggerType(String _trigger, String _text, String _description, List _jobStatusList) { this.trigger = _trigger; this.text = _text; this.description = _description; + this.jobStatusList = _jobStatusList; } @Override @@ -65,4 +77,13 @@ public enum AutoexecJobNotifyTriggerType implements INotifyTriggerType { } return null; } + + public static AutoexecJobNotifyTriggerType getTriggerByStatus(String status) { + for (AutoexecJobNotifyTriggerType n : values()) { + if (n.jobStatusList.contains(status)) { + return n; + } + } + return null; + } } diff --git a/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyTriggerType.java b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyTriggerType.java new file mode 100644 index 00000000..0f86f365 --- /dev/null +++ b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyTriggerType.java @@ -0,0 +1,68 @@ +/*Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.framework.autoexec.constvalue; + +import neatlogic.framework.notify.core.INotifyTriggerType; +import neatlogic.framework.util.$; + +public enum AutoexecNotifyTriggerType implements INotifyTriggerType { + + CREATE_JOB_FAILED("createjobfailed", "nfac.autoexecnotifytriggertype.text.createjobfailed", "nfac.autoexecnotifytriggertype.description.createjobfailed"), + ; + + private final String trigger; + private final String text; + private final String description; + + AutoexecNotifyTriggerType(String _trigger, String _text, String _description) { + this.trigger = _trigger; + this.text = _text; + this.description = _description; + } + + @Override + public String getTrigger() { + return trigger; + } + + @Override + public String getText() { + return $.t(text); + } + + @Override + public String getDescription() { + return $.t(description); + } + + public static String getText(String trigger) { + for (AutoexecNotifyTriggerType n : values()) { + if (n.getTrigger().equals(trigger)) { + return n.getText(); + } + } + return ""; + } + + public static AutoexecNotifyTriggerType getTrigger(String trigger) { + for (AutoexecNotifyTriggerType n : values()) { + if (n.getTrigger().equals(trigger)) { + return n; + } + } + return null; + } +} -- Gitee From 9a06f90b926d07c32fde279b03d3370027e95e82 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Wed, 21 Aug 2024 14:45:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E9=80=9A=E7=9F=A5=E7=AD=96=E7=95=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1227345283743744]自动化通知策略增加触发点 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1227345283743744 --- .../constvalue/AutoexecNotifyParam.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyParam.java diff --git a/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyParam.java b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyParam.java new file mode 100644 index 00000000..74a51047 --- /dev/null +++ b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecNotifyParam.java @@ -0,0 +1,49 @@ +/*Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.framework.autoexec.constvalue; + +import neatlogic.framework.common.constvalue.ParamType; +import neatlogic.framework.notify.core.INotifyParam; +import neatlogic.framework.util.$; + +public enum AutoexecNotifyParam implements INotifyParam { + CREATE_JOB_FAILED_CONTENT("createjobfailedcontent", "创建作业失败原因", ParamType.STRING), + ; + private final String value; + private final String text; + private final ParamType paramType; + + AutoexecNotifyParam(String value, String text, ParamType paramType) { + this.value = value; + this.text = text; + this.paramType = paramType; + } + + @Override + public String getValue() { + return value; + } + + @Override + public String getText() { + return $.t(text); + } + + @Override + public ParamType getParamType() { + return paramType; + } +} -- Gitee